Cloud Datum Stream Update¶
Make changes to an existing Cloud Datum Stream entity.
The changes to make can be provided by a combination of methods:
- Standard input, as a JSON object in the form supported by the Cloud Datum Stream update API.
- Command line options
- Command line parameter, including
@@file reference
For example, the following invocations produce equivalent results:
# using standard input
echo '{"enabled":false}' |s10k cloud-integrations datum-streams update --stream-id 100
# using parameter value
s10k cloud-integrations datum-streams update --stream-id 100 '{"enabled":false}'
# using parameter file reference - my-file.json contains {"enabled":false}
s10k cloud-integrations datum-streams update --stream-id 100 @@my-file.json
# using option
s10k cloud-integrations datum-streams update --stream-id 100 --disabled
The methods can be combined, with each method overriding settings duplicated in previous methods.
For example the following ends up changing the schedule to 300 because the command line parameter
override both the --schedule option and standard input values:
echo '{"schedule":900}' |s10k cloud-integrations datum-streams update --stream-id 100 \
--schedule 600 '{"schedule":300}'
Usage¶
s10k cloud-integrations datum-streams update
[-rI]
-stream=<datumStreamId>
[-S=<serviceIdentifier>]
[-m=<name>]
[-source=<sourceId>]
[-map=<mappingId>]
[-w=<schedule>]
[-prop=serviceProperty]...
[-node=<nodeId> | -loc=<locationId>]
[-e | -d]
[-mode=<displayMode>]
Tip
Use the --dry-run global option to preview the update,
without actually changing anything. For example:
s10k --dry-run cloud-integrations datum-streams update --stream-id 100 --disabled
Replace vs merge¶
By default the setting updates given as input to this command are merged into any existing settings on the datum stream entity. Thus you only need to provide values for settings you need to change, and all other settings will remain the same.
You can instead replace all settings with new values by including the --replace option. In this
mode you must provide the entire configuration required by a cloud datum stream, and any optional
settings you do not provide will end up empty in the updated entity. This mode can be handy if you
are generating a full configuration JSON document outside of this tool, and then provide that as
standard input to this command.
--service-property option¶
The --service-property option allows you to make changes to the service properties metadata. It
takes the form path:value where path is a /-delimited path in the metadata document to update.
For example imagine a datum stream with these service properties:
{
"placeholders": {
"siteId": 123456
}
}
You could add another placeholder for deviceId like this:
s10k cloud-integrations datum-streams update --stream-id 100 \
--service-property placeholders/deviceId=ABCDEF
That would result in service properties like this:
{
"placeholders": {
"siteId": 123456,
"deviceId": "ABCDEF"
}
}
Multiple --service-property options are allowed, and they are processed in the order given on
the command line.
Special service property encodings¶
The value given in a --service-property path:value option can be interpreted in some alternate
ways by changing the : delimiter to one of the following:
| Delimiter | Description |
|---|---|
{: |
Treat as JSON. For example a sourceIdMap setting could be provided like sourceIdMap{:{"/site123/dev234":"/BLD1/INV/1","/site123/dev567":"/BLD1/INV/2"} |
%: |
Treat as a comma-delimited list of equal-delimited key-value mappings. For example a sourceIdMap setting could be provided like sourceIdMap%:/site123/dev23=/BLD1/INV/1,/site123/dev567=/BLD1/INV/2 |
[: |
Treat as a comma-delimited list. For example a virtualSourceIds setting could be provided like virtualSourceIds[:/BLD1/GEN/1,/BLD1/GEN/2 |
#: |
Treat as a comma-delimited unique list. Duplicate values will be discarded. |
Service property file references¶
A --service-property value can be also be given as a JSON file reference in the form @@file-path.
For example, --service-property @@settings.json. The contents of the file must be a JSON object,
whose properties will be configured directly as service properties.
Warning
The JSON properties loaded from the given file will be added to any existing service properties, and replace any existing service properties.
Output¶
The updated datum stream.