Skip to content

Instructions Settings Update

Update the settings on a node. Use the list-components and list-services commands to discover the available services, and settings view to view the current settings on a service.

Usage

s10k instructions settings update [-s=<serviceId>] [-c=<componentId>]
                                -node=<nodeId> [<setting>...]

Options

Option Long Version Description
-node= --node-id= the node ID to list the control IDs for
-s= --service-id= a service ID, or if -c provided the component instance ID, to view the settings for
-c= --component-id= a component ID to list the available service instances for

Parameters

Provide either key and value setting pairs (requires the --service-id and optionally --component-id options) or the path to a CSV file, prefixed by @@.

Alternatively you can provide CSV via standard input. When using CSV a setting can be removed by specifying an empty value for that setting key.

Output

A result status message.

Examples

You can update one or more settings for a specific service on a node by providing --service-id and optionally --component-id options along with pairs of key and value setting parameters. The following example will update the schedule setting of a Control Datum Source component with ID 1 to "every 30 seconds":

Update schedule for component instance to 30s
s10k instructions settings update --node-id 101 \
    --component-id net.solarnetwork.node.datum.control \
    --service-id 1 \
    schedule '0/30 * * * * *'

Alternatively you can update settings for a single component from a CSV file like this (extra columns are allowed and will be ignored). The following example updates two settings of a Control Datum Source component with ID 1:

s10k instructions settings update --node-id 101 \
    --component-id net.solarnetwork.node.datum.control \
    --service-id 1 \
    @@my-service.csv
my-service.csv
Key,Value
schedule,0/30 * * * * *
jobService.multiDatumDataSource.eventModeValue,CaptureAndChange

You can also provide a full settings csv file to update the settings on an arbitrary number of service and component instances. The following example updates settings on two different components:

s10k instructions settings update --node-id 101 @@my-settings.csv
my-settings.csv
key,type,value
net.solarnetwork.node.datum.control.1,jobService.multiDatumDataSource.eventModeValue,CaptureAndChange
net.solarnetwork.node.datum.control.1,jobService.multiDatumDataSource.persistModeValue,Poll
net.solarnetwork.node.datum.control.1,schedule,0/30 * * * * *
net.solarnetwork.node.datum.control.FACTORY,1,1
net.solarnetwork.node.control.mock.Limit,controlId,limit/1
net.solarnetwork.node.control.mock.Limit,controlTypeValue,f
net.solarnetwork.node.control.mock.Limit,initialControlValue,0
net.solarnetwork.node.control.mock.FACTORY,Limit,Limit

The following example deletes some settings, by providing empty values in a CSV resource:

s10k instructions settings update --node-id 101 @@my-settings.csv
my-settings.csv
key,type,value
net.solarnetwork.node.control.mock.Limit,controlId,
net.solarnetwork.node.control.mock.Limit,controlTypeValue,
net.solarnetwork.node.control.mock.Limit,initialControlValue,
net.solarnetwork.node.control.mock.FACTORY,Limit,