-
Notifications
You must be signed in to change notification settings - Fork 2
SolarUser API enumerated types
This page lists the enumerated types used throughout the SolarUser API.
These define the various processing states an instruction can be in. Instructions are processed
asynchronously, and instructions proceed through these states over time as instructions are
transmitted to the node, executed on the node, and finally reported as Completed
or Declined
.
Unknown
-
Queuing
- The instruction is being queued, but not acknowledged by the node yet. -
Queued
- The instruction has been queued, but not acknowledged by the node yet. -
Received
- The instruction has been acknowledged, but has not been examined yet. -
Executing
- The instruction has been acknowledged and is being executed currently. -
Declined
- The instruction was acknowledged but has been declined and will not be executed. -
Completed
- The instruction was acknowledged and has been executed.
SolarNet does not restrict the instruction topics that can be used as instruction topics—it is up to the SolarNode receiving each instruction to determine how to execute the topic specified by the instruction. Here are some well known topics supported by standard SolarNode plugins:
Topic | Description |
---|---|
CancelInstruction |
Cancel a deferred instruction |
DatumExpression |
Execute a datum expression |
DisableOperationalModes |
Disable an Operational Mode |
EnableOperationalModes |
Enable an Operational Mode |
ExecuteInstructions |
Execute a set of instructions |
LoggingSetLevel |
Set a logger level |
RenewCertificate |
Renew a node's certificate |
SetControlParameter |
Set a control value |
SetOperatingState |
Set the operating state of a device |
ShedLoad |
Request a device to reduce its power consumption |
Signal |
Send a "signal" message to a control or device component |
StartRemoteSsh |
Start a SolarSSH remote management session |
StopRemoteSsh |
Stop a SolarSSH remote management session |
SystemConfiguration |
Get configuration for a service. |
SystemReboot |
Reboot the device SolarNode is running on |
SystemRestart |
Restart the SolarNode service |
UpdatePlatform |
Update the S3 Setup-based SolarNode platform |
This instruction asks a node to cancel a previously-received instruction, by changing its state
from Received
to Declined
. This is designed to work with
deferred instructions.
Parameter | Description |
---|---|
id |
The ID of the deferred instruction to cancel. |
For example, to set the state of instruction 12345
to Declined
, you would include these parameters:
Parameter | Value |
---|---|
parameters[0].name |
id |
parameters[0].value |
12345 |
This instructions asks a node to evaluate a datum expression and return the result.
Parameter | Description |
---|---|
expression |
The expression to evaluate. |
lang |
The ID of the expression language to use. See table below for possible values. If not provided then SpEL will be assumed. |
Supported expression languages are:
Language | ID |
---|---|
SpEL | net.solarnetwork.common.expr.spel.SpelExpressionService |
Once the node executes the expression the result will be returned on a result
instruction result
parameter.
Here is an example using the JSON syntax to request a sum total of power across several meter devices:
POST /solaruser/api/v1/sec/instr/add/DatumExpression
{
"nodeId": 123,
"params": {
"expression": "sum(latestMatching('/power/*').![watts * powerFactor])"
}
}
Once the node executes the expression the result will be provided in the result parameters:
{
"success": true,
"data": {
"id": 11537648,
"created": "2024-04-03 17:27:41.591906Z",
"topic": "DatumExpression",
"instructionDate": "2024-04-03 17:27:41.591825Z",
"statusDate": "2024-04-03 17:27:41.601474Z",
"state": "Completed",
"parameters": [
{
"name": "expression",
"value": "sum(latestMatching('/power/*').![watts * powerFactor])"
}
],
"nodeId": 123,
"resultParameters": {
"result": 12359.99964279
}
}
}
This instruction asks a node to activate one or more operational modes. This instruction takes the following parameters:
Parameter | Description |
---|---|
OpMode |
An operational mode to deactivate. Any number of OpMode parameters can be provided to deactivate multiple modes. |
For example, to disable an inverters-off
mode, you would include these parameters:
Parameter | Value |
---|---|
parameters[0].name |
OpMode |
parameters[0].value |
inverters-off |
This instruction asks a node to activate one or more operational modes. This instruction takes the following parameters:
This instruction takes the following parameters:
Parameter | Description |
---|---|
OpMode |
An operational mode to activate. Any number of OpMode parameters can be provided to activate multiple modes. |
Expiration |
An optional date at which the modes should automatically be disabled, as milliseconds since the Unix epoch. If not provided the modes will remain active until deactivated via a DisableOperationalModes instruction. If an operational mode is already active, this value will replace any existing expiration date for that mode. |
For example, to enable an inverters-off
mode that automatically expires on August 1, 2019 at
midnight UTC, you would include these parameters:
Parameter | Value |
---|---|
parameters[0].name |
OpMode |
parameters[0].value |
inverters-off |
parameters[1].name |
Expiration |
parameters[1].value |
1564617600000 |
This instruction allows multiple arbitrary instructions to be executed as a group.
This instruction takes the following parameters:
Parameter | Description |
---|---|
failFast |
When true then instruction processing should stop immediately after any nested instruction fails to complete successfully. When false (the default) then all instructions should be executed, regardless of any individual failures. If the successMode is Some this parameter is ignored. |
successMode |
Either Every (the default) or Some . When Every then all nested instructions must complete successfully for the ExecuteInstructions to end in the Completed state, otherwise it will end in the Declined state. When Some then at least one instruction must complete successfully for the ExecuteInstructions to end in the Completed state. An instruction is considered successful if it is handled and returns a status in either Completed or Executing state. |
instructions |
A JSON array of nested instruction objects. See the /instr/add/{topic} API for details on the format of each instruction object. Note that the nodeId property is not needed on these instructions, as it is assumed to be the ID of the node executing the ExecuteInstructions instruction. |
Here is an example using the JSON syntax to execute two SetControlParameter
instructions with a POST
to /solaruser/api/v1/sec/instr/add/ExecuteInstructions
:
{
"nodeId": 123,
"params": {
"instructions": "[{\"topic\":\"SetControlParameter\",\"params\":{\"/battery/rate\":\"-1500\"}},{\"topic\":\"SetControlParameter\",\"params\":{\"/grid/target\":\"-1250\"}}]"
}
}
The two instructions in the instructions
property look like then, when decoded into a JSON array:
[
{"topic":"SetControlParameter","params":{"/battery/rate":"-1500"}},
{"topic":"SetControlParameter","params":{"/grid/target":"-1250"}}
]
This instruction updates a node's logging verbosity by adjusting the level of one or more loggers. See SolarNode Logging for information about how SolarNode logging works.
This instruction takes the following parameters:
Parameter | Description |
---|---|
logger |
A comma-delimited list of logger names to update. More than one of this parameter can be provided; all loggers provided will be adjusted. |
level |
The logging verbosity. See below for more information. |
The following levels are supported for the level
instruction parameter:
Level | Description |
---|---|
inherit |
Inherit the level from the logger's parent hierarchy. |
trace |
The highest level of verbosity for tracing messages. Includes all other levels. |
debug |
The 2nd highest level of verbosity for debugging messages. Includes info , warn , and error levels. |
info |
A "default" level of verbosity for informational messages. Includes warn and error levels. |
warn |
The 2nd most urgent level of verbosity for potential problems. Includes the error level. |
error |
The most urgent level of verbosity for error conditions. |
off |
No logging at all. |
Here is an example using the JSON syntax to adjust the net.solarnetwork.node.io.modbus
and
net.solarnetwork.node.datum.modbus
loggers to trace
level:
POST /solaruser/api/v1/sec/instr/add/LoggingSetLevel
{"nodeId":123,"params":{"logger":"net.solarnetwork.node.io.modbus,net.solarnetwork.node.datum.modbus","level":"trace"}}
This instruction asks a node to install a renewed X.509 client certificate. It contains the following parameters:
Parameter | Description |
---|---|
Certificate |
The PEM-encoded PKCS7 renewed certificate chain. |
Because instruction parameters have a limited supported length, the instruction might
split the certificate data into more than one Certificate
parameter. The client must
join all returned Certificate
parameters together, in the order received, to
access the certificate data.
This instruction sets the value of a hardware control on the SolarNode to a
specific value. You must provide a single parameter where the name is the
control name to manipulate and the value is the value to set the control to.
For example, to set the /power/switch/1
control to 1
you would include these
parameters:
Parameter | Value |
---|---|
parameters[0].name |
/power/switch/1 |
parameters[0].value |
1 |
This instruction requests the node to update the operating state of a device. For example this can be used to turn a device on or off.
Parameter | Description |
---|---|
control ID | The parameter name is the ID of the control to set the operating state on. Typically this is the same as the source ID if a device. The value should be a valid device operating state code or name. |
For example, to set the state of /power/inverter/1
to Shutdown
(off), you'd include these parameters:
Parameter | Value |
---|---|
parameters[0].name |
/power/inverter/1 |
parameters[0].value |
Shutdown |
This instruction requests the node to reduce the power of a device managed by a specific control by a specific amount. The actual meaning of reduce is flexible, in that in some systems a "reduction" can be achieved via the extra supply of the requested power.
Parameter | Description |
---|---|
control ID | The parameter name is the ID of the control to handle the instruction. The value should be the number of watts to reduce the power by. If a value of 0 is requested, then stop actively managing the load. |
For example, to shed 1 kW from the /power/1
control, you'd include these parameters:
Parameter | Value |
---|---|
parameters[0].name |
/power/1 |
parameters[0].value |
1000 |
This instruction provides a way to send a named signal to a specific control. Signal names are defined by the control that supports this instruction. At a minimum the following parameters are expected:
Parameter | Description |
---|---|
control ID | The parameter name is the ID of the control to signal. Typically this is the same as the source ID if a device. The value should be a the name of the signal to invoke. |
Individual signals are free to define additional parameter values to go along with the instruction.
Consult the documentation for the control that supports this instruction for more information. For
example, to request an image capture from the /camera/1
control, you might include these parameters:
Parameter | Value |
---|---|
parameters[0].name |
/camera/1 |
parameters[0].value |
snapshot |
This instruction requests the node to establish a SSH connection to a specific host for the purposes of system administration. It contains the following parameters:
host
|
The host to SSH to (hostname or IP address). |
---|---|
user
|
The username to connect as. |
port
|
The port on host to connect on. |
rport
|
The first of two reverse port forwarding ports
the server will allow. The port provided here must be forwarded
back to a SSH server on the node, typically port A second reverse port is implied, as |
This instruction requests the node to disconnect a SSH connection, presumably
previously started via the StartRemoteSsh
instruction. It contains
the same parameters as StartRemoteSsh
, so the connection can be
uniquely identified by the parameters.
This instruction requests the node to get configuration for a service. The nature of the returned configuration is service-specific. It supports the following core parameters:
Parameter | Description |
---|---|
service |
The ID of the service to get the configuration of. |
The following service
values represent some standard services supported in SolarNode:
Service | Description |
---|---|
net.solarnetwork.node.controls |
Will return a comma-delimited list of all available control IDs in a result parameter. An optional filter instruction parameter can be provided, as a wildcard pattern to restrict the returned control IDs to those that match the pattern. |
net.solarnetwork.node.packages |
Will return a JSON array of package information, see below for more information. |
net.solarnetwork.node.settings |
Will return a JSON string of runtime settings, see below for more information. |
The net.solarnetwork.node.packages
service can return information about the software packages
installed or available to install. The result is returned as an array of package objects
on the result
result parameter. The additional parameters supported by this instruction are:
Parameter | Description |
---|---|
compress |
This optional parameter, when true , requests the result to be return as gzip-compressed JSON and encoded as a Base64 string. This can be helpful when working with complex components with many configurable settings, where the result can be large. If the compressed result is larger than the uncompressed JSON then the original results will be returned instead, unless this parameter is set to force . |
filter |
An optional parameter for a regular expression to match against package names. Only package names that match the pattern will be returned in the result. If unspecified a default pattern of (^sn-|solarnode) will be used (match packages whose names start with sn- or contain solarnode ). |
status |
An optional parameter that can be one of Installed (include only installed packages, the default if not specified), Available (include only pacakges that are not currently installed), or All (include both installed and available packages). |
The result
result parameter will be a JSON array of package objects. Each package object
contains the following properties:
Property | Type | Description |
---|---|---|
name |
string | The name of the package. |
version |
string | The version of the package. |
installed |
boolean |
true if the package is currently installed. |
An example instruction after completing looks like this as JSON:
{
"success": true,
"data": {
"id": 123123123,
"created": "2024-06-11 21:39:09.154986Z",
"topic": "SystemConfiguration",
"instructionDate": "2024-06-11 21:39:09.154867Z",
"statusDate": "2024-06-11 21:39:09.649036Z",
"state": "Completed",
"parameters": [
{
"name": "service",
"value": "net.solarnetwork.node.packages"
}
],
"nodeId": 123,
"resultParameters": {
"result": [
{
"name": "sn-solarpkg",
"version": "1.3.0-1",
"installed": true
},
{
"name": "sn-system",
"version": "1.7.0-1",
"installed": true
},
{
"name": "solarnode-app-core",
"version": "3.20.0-1",
"installed": true
},
{
"name": "solarnode-app-db-h2",
"version": "2.0.1-1",
"installed": true
},
{
"name": "solarnode-app-solarflux",
"version": "1.1.0-1",
"installed": true
},
{
"name": "solarnode-base",
"version": "4.1.1-1",
"installed": true
}
]
}
}
}
If the compress
parameter is used to provide compressed results, the completed instruction
would look like this:
{
"success": true,
"data": {
"id": 123123123,
"created": "2024-06-11 22:22:23.335316Z",
"topic": "SystemConfiguration",
"instructionDate": "2024-06-11 22:22:23.335258Z",
"statusDate": "2024-06-11 22:22:23.87532Z",
"state": "Completed",
"parameters": [
{
"name": "service",
"value": "net.solarnetwork.node.packages"
},
{
"name": "compress",
"value": "true"
}
],
"nodeId": 123,
"resultParameters": {
"result": "H4sIAAAAAAAA/6WW227jIBRF/8XPxXJtVzPqr4zmATs4JcVAOZBJNOq/F9t5GE7oAI4i5b4XsM+NX38rSWdWvVaGnZU4MwJKUCPVgRGqNRmVYdVTdWYGuJL+b139s27Is/+OS7BUCHaoXq1x7PPpP6iBQoh5rvskBiSZB62EQMqXuk0r5WTpIBggrX+ktQr8j/ZO2ZA2pdQcqdqcU2pOHAwEnNbK4HWzCOZiL5H9JnVrhAY6vjuN5I2XN1ly/X5E2i57aYC3yLpdUnsFy2ak/JGz6h8+4RD16cAGJeHtkgxHqUnnVaqu2iZ9gIBxoNbNExfWQ8qTJkQN5K0NGG3xkbiKW5ORiHHO7aU/oY3tAM6DwxaVun2jkNP2HKm4UtMXojrgnXW7zrdyiOSTvZITjMixtu6KiR82DGS/yzFPIT6G9vo4C5jhVCCvdnMiLpWyhLooicdaKSSamWWFF0miBfJSBInOvNLDALNOx3psMWj5NAm3Y6iFHCdBs/EBg+9uLn3OHSKQ+2Y/z0oCEVQeO1zsJV1jpaFGXWbuSjj5gQ9efI/JnYMb5ttOWBKmDbUV5WIUbvZN3Zex7tvNjrNtnfTWVnGr8PmTccUJgYbR0fLlUmz92/mRabTyQBsuj9X+DvYPxdft6AxHrn2P+/0FUb4oXTYMAAA="
}
}
}
The net.solarnetwork.node.settings
service can return the configuration (settings) for any
configurable component and component factory available in the SolarNode runtime. This can be used
to discover the configuration of a node. The result is returned as a JSON string on the result
result parameter. The additional parameters supported by this instruction are:
Parameter | Description |
---|---|
uid |
This required parameter represents the unique ID of the component you are interested in. |
id |
This optional parameter represents the instance ID of the factory component you are interested in, implying that uid is the ID of a factory component. |
compress |
This optional parameter, when true , requests the JSON result to be gzip-compressed and encoded as a Base64 string. This can be helpful when working with complex components with many configurable settings, where the JSON result can be large. |
spec |
This optional parameter, when true , causes specification objects to be returned instead of setting values. This can be used by tools to understand what settings are available. |
The presence of the id
parameter, along with a special *
value for both the uid
and id
parameters, determines the result output according to the following table:
uid |
id |
Operation |
---|---|---|
* |
List providers | |
{settingUid} | List settings | |
* |
* |
List factories |
{factoryUid} | * |
List factory instances |
{settingUid} | {instanceId} | List factory instance settings |
Pass a uid
value of *
to generate a JSON array of objects, each object representing a setting
component. Each component object contains the following properties:
Property | Description |
---|---|
id |
The provider ID. |
title |
A description of the provider. |
For example:
{
"result":"[{\"id\":\"net.solarnetwork.node.backup.DefaultBackupManager\",\"title\":\"Backup Manager\"},{\"id\":\"net.solarnetwork.node.backup.s3.S3BackupService\",\"title\":\"S3 Backup Service\"},{\"id\":\"net.solarnetwork.node.control.bacnet.csv\",\"title\":\"BACnet Control CSV Configurer\"},{\"id\":\"net.solarnetwork.node.control.modbus.csv\",\"title\":\"Modbus Control CSV Configurer\"}]"
}
Parsing the result
value as JSON you can see the result structure more clearly:
[
{"id":"net.solarnetwork.node.backup.DefaultBackupManager","title":"Backup Manager"},
{"id":"net.solarnetwork.node.backup.s3.S3BackupService","title":"S3 Backup Service"},
{"id":"net.solarnetwork.node.control.bacnet.csv","title":"BACnet Control CSV Configurer"},
{"id":"net.solarnetwork.node.control.modbus.csv","title":"Modbus Control CSV Configurer"}
]
Pass a uid
value of the non-factory setting component ID to generate a JSON array of setting
objects for that component. Each setting object contains the following properties:
Property | Description |
---|---|
key |
The setting key. |
value |
The setting value. |
default |
If present, a boolean value that, when true , indicates the value is a node-provided default, not a user-configured value. |
For example:
{
"result":"[{\"key\":\"job.instructionAcknowledgementUploader.cron\",\"value\":\"35 * * * * ?\",\"default\":true},{\"key\":\"job.instructionCleaner.cron\",\"value\":\"50 * * * * ?\",\"default\":true},{\"key\":\"job.instructionExecution.cron\",\"value\":\"10 * * * * ?\"}]"
}
Parsing the result
value as JSON you can see the result structure more clearly:
[
{"key":"job.instructionAcknowledgementUploader.cron","value":"35 * * * * ?","default":true},
{"key":"job.instructionCleaner.cron","value":"50 * * * * ?","default":true},
{"key":"job.instructionExecution.cron","value":"10 * * * * ?"}
]
Note that the
spec
instruction parameter, iftrue
, causes specification objects to be returned instead of setting objects.
Pass a uid
value of *
and an id
value of *
to generate a JSON array of objects, each
object representing a setting factory component. Each factory component has the same properties as
shown in the List providers section.
For example:
{
"result":"[{\"id\":\"net.solarnetwork.node.control.bacnet\",\"title\":\"BACnet Control\"},{\"id\":\"net.solarnetwork.node.control.gpiod\",\"title\":\"GPIO Control\"},{\"id\":\"net.solarnetwork.node.control.modbus\",\"title\":\"Modbus Control\"},{\"id\":\"net.solarnetwork.node.datum.bacnet\",\"title\":\"BACnet Device\"}]"
}
Parsing the result
value as JSON you can see the result structure more clearly:
[
{"id":"net.solarnetwork.node.control.bacnet","title":"BACnet Control"},
{"id":"net.solarnetwork.node.control.gpiod","title":"GPIO Control"},
{"id":"net.solarnetwork.node.control.modbus","title":"Modbus Control"},
{"id":"net.solarnetwork.node.datum.bacnet","title":"BACnet Device"}
]
Pass a uid
value of a factory component ID and an id
value of *
to generate a JSON array
of strings, each representing a setting factory component instance ID for the given factory. For
example:
{
"result":"[\"Meter\",\"Inverter\",\"Pyrometer\",\"Weather\"]"
}
Parsing the result
value as JSON you can see the result structure more clearly:
["Meter","Inverter","Pyrometer","Weather"]
Pass a uid
value of a factory component ID and an id
value of an associated instance ID to
generate a JSON array of setting objects for the given factory instance. Each setting object has the
same properties as shown in the List settings
section. For example:
{
"result":"[{\"key\":\"schedule\",\"value\":\"6000\"},{\"key\":\"jobService.datumDataSource.uid\",\"value\":\"\",\"default\":true},{\"key\":\"jobService.datumDataSource.groupUid\",\"value\":\"\",\"default\":true},{\"key\":\"jobService.datumDataSource.publishDeviceInfoMetadata\",\"value\":true,\"default\":true},{\"key\":\"jobService.datumDataSource.sourceId\",\"value\":\"/power/1\"},{\"key\":\"jobService.datumDataSource.voltage\",\"value\":\"230.0\",\"default\":true},{\"key\":\"jobService.datumDataSource.frequency\",\"value\":\"50.0\",\"default\":true},{\"key\":\"jobService.datumDataSource.resistance\",\"value\":\"10.0\",\"default\":true},{\"key\":\"jobService.datumDataSource.inductance\",\"value\":\"10.0\",\"default\":true},{\"key\":\"jobService.datumDataSource.randomness\",\"value\":\"true\"},{\"key\":\"jobService.datumDataSource.voltdev\",\"value\":\"3\"},{\"key\":\"jobService.datumDataSource.freqdev\",\"value\":\"0.1\"},{\"key\":\"jobService.datumDataSource.resistanceDeviation\",\"value\":\"5.0\"},{\"key\":\"jobService.datumDataSource.inductanceDeviation\",\"value\":\"2.0\"}]"
}
Parsing the result
value as JSON you can see the result structure more clearly:
[
{"key":"schedule","value":"6000"},
{"key":"jobService.datumDataSource.uid","value":"","default":true},
{"key":"jobService.datumDataSource.groupUid","value":"","default":true},
{"key":"jobService.datumDataSource.publishDeviceInfoMetadata","value":true,"default":true},
{"key":"jobService.datumDataSource.sourceId","value":"/power/1"},
{"key":"jobService.datumDataSource.voltage","value":"230.0","default":true},
{"key":"jobService.datumDataSource.frequency","value":"50.0","default":true},
{"key":"jobService.datumDataSource.resistance","value":"10.0","default":true},
{"key":"jobService.datumDataSource.inductance","value":"10.0","default":true},
{"key":"jobService.datumDataSource.randomness","value":"true"},
{"key":"jobService.datumDataSource.voltdev","value":"3"},
{"key":"jobService.datumDataSource.freqdev","value":"0.1"},
{"key":"jobService.datumDataSource.resistanceDeviation","value":"5.0"},
{"key":"jobService.datumDataSource.inductanceDeviation","value":"2.0"}
]
Note that the
spec
instruction parameter, iftrue
, causes specification objects to be returned instead of setting objects.
If the spec
instruction parameter has the value true
then the structure of the
List settings and
List factory instance settings
results change into specification objects instead of setting objects. Each specification object
has a minimum of a type
property that represents the type of setting. Different setting types
provide other properties.
Here is an example specification result decoded to JSON:
[
{
"key": "string",
"type": "net.solarnetwork.settings.TextFieldSettingSpecifier",
"defaultValue": "simple"
},
{
"key": "password",
"type": "net.solarnetwork.settings.TextFieldSettingSpecifier",
"secureTextEntry": true
},
{
"key": "integer",
"type": "net.solarnetwork.settings.TextFieldSettingSpecifier",
"defaultValue": "42"
},
{
"key": "toggle",
"type": "net.solarnetwork.settings.ToggleSettingSpecifier",
"defaultValue": false,
"falseValue": false,
"trueValue": true
},
{
"key": "slide",
"type": "net.solarnetwork.settings.SliderSettingSpecifier",
"defaultValue": 5.0,
"minimumValue": 0.0,
"maximumValue": 10.0,
"step": 0.5
},
{
"key": "radio",
"type": "net.solarnetwork.settings.RadioGroupSettingSpecifier",
"defaultValue": "One",
"valueTitles": {
"One": "One",
"Two": "Two",
"Three": "Three"
}
},
{
"key": "menu",
"type": "net.solarnetwork.settings.MultiValueSettingSpecifier",
"defaultValue": "Option 1",
"valueTitles": {
"Option 1": "Option 1",
"Option 2": "Option 2",
"Option 3": "Option 3"
}
},
{
"key": "locationKey",
"type": "net.solarnetwork.node.settings.LocationLookupSettingSpecifier",
"defaultValue": 11536821,
"locationTypeKey": "price"
},
{
"key": "weatherLocationKey",
"type": "net.solarnetwork.node.settings.LocationLookupSettingSpecifier",
"defaultValue": 11536821,
"locationTypeKey": "weather"
},
{
"key": "textAreaDirect",
"type": "net.solarnetwork.settings.TextAreaSettingSpecifier",
"direct": true
},
{
"key": "textArea",
"type": "net.solarnetwork.settings.TextAreaSettingSpecifier"
},
{
"key": "file",
"type": "net.solarnetwork.node.settings.FileSettingSpecifier",
"acceptableFileTypeSpecifiers": [
".txt",
"text/*"
]
},
{
"key": "textFiles",
"type": "net.solarnetwork.node.settings.FileSettingSpecifier",
"acceptableFileTypeSpecifiers": [
".txt",
"text/*"
],
"multiple": true
},
{
"type": "net.solarnetwork.node.settings.SetupResourceSettingSpecifier",
"setupResourceProperties": {"foo": "bar"}
},
{
"type": "net.solarnetwork.settings.GroupSettingSpecifier",
"dynamic": true,
"groupSettings": [
{
"key": "listString[0]",
"type": "net.solarnetwork.settings.TextFieldSettingSpecifier"
}
]
},
{
"type": "net.solarnetwork.settings.GroupSettingSpecifier",
"dynamic": true,
"groupSettings": [
{
"type": "net.solarnetwork.settings.GroupSettingSpecifier",
"dynamic": false,
"groupSettings": [
{
"key": "listComplex[0].firstName",
"type": "net.solarnetwork.settings.TextFieldSettingSpecifier"
},
{
"key": "listComplex[0].lastName",
"type": "net.solarnetwork.settings.TextFieldSettingSpecifier"
},
{
"key": "listComplex[0].genderValue",
"type": "net.solarnetwork.settings.MultiValueSettingSpecifier",
"defaultValue": "Other",
"valueTitles": {
"Male": "Male",
"Female": "Female",
"Other": "Other"
}
},
{
"key": "listComplex[0].phone",
"type": "net.solarnetwork.settings.TextFieldSettingSpecifier"
},
{
"key": "listComplex[0].age",
"type": "net.solarnetwork.settings.TextFieldSettingSpecifier"
},
{
"key": "listComplex[0].enabled",
"type": "net.solarnetwork.settings.ToggleSettingSpecifier",
"defaultValue": true,
"falseValue": false,
"trueValue": true
}
]
}
]
}
]
The net.solarnetwork.settings.GroupSettingSpecifier
specification type
represents a group of
other specifications. This object will include a dynamic
boolean property, that, when true
,
represents a dynamic-sized list of settings. The groupSettings
property will be an array of
other specification objects.
Most other specification objects provide a key
property that represents the unique identifier
for the setting.
This instruction requests the node to reboot the device SolarNode is running on.
This instruction requests the node to restart the SolarNode service.
This instruction is supported by the S3 Setup SolarNode plugin, and can be used to request a node to download and install either the latest or a specific version of a S3 Setup package. It supports the following parameters:
Version
|
The package version to install. If not specified, then the latest package should be installed. |
---|
This instruction requests the node to update a configurable runtime setting value. If the setting does not exist, it should be added.
Parameter | Description |
---|---|
key |
The setting key to update. |
type |
The optional setting type to update. |
value |
The setting value. |
flags |
The optional setting flags, as a bitmask. |
Multiple settings can be set as long as there are an equal number of key
/type
/value
parameters. They will be formed into individual settings by parameter order. For example
a request with the following parameters:
Parameter | Value |
---|---|
parameters[0].name |
key |
parameters[0].value |
k1 |
parameters[1].name |
type |
parameters[1].value |
t1 |
parameters[2].name |
value |
parameters[2].value |
v1 |
parameters[3].name |
key |
parameters[3].value |
k2 |
parameters[4].name |
type |
parameters[4].value |
t2 |
parameters[5].name |
value |
parameters[5].value |
v2 |
would logically define two settings like:
Key | Type | Value |
---|---|---|
k1 | t1 | v1 |
k2 | t2 | v2 |
This enumeration defines the possible types for datum auxiliary records.
Name | Description |
---|---|
Reset |
A device has been reset or replaced. This is used to transition a datum source when equipment is replaced or reset. |
This enumeration defines the possible states a datum export task can be in. Each state has both a
name and key. Some APIs use the key values. Export tasks generally start in the Queued
state, then
will transition to Executing
and then finally Completed
.
Name | Key | Description |
---|---|---|
Unknown |
u |
The state is not known. |
Queued |
q |
The export job has been queued, but not started yet. |
Claimed |
p |
The export job as been claimed for execution but has not started executing yet. |
Executing |
e |
The export task is currently executing. |
Completed |
c |
The export task has completed. |
This enumeration defines the possible states a datum import task can be in. Each state has both a
name and key. Some APIs use the key values. Import tasks generally start in Staged
or Queued
state, then will transition to Executing
and then finally Completed
.
Name | Key | Description |
---|---|---|
Unknown |
u |
The state is not known. |
Staged |
s |
The import job has been submitted, but will not automatically transition out of this state. |
Retracted |
r |
The import job has been cancelled after being in the Staged state. |
Queued |
q |
The import job has been queued, but not started yet. |
Claimed |
p |
The import job as been claimed for execution but has not started executing yet. |
Executing |
e |
The import task is currently executing. |
Completed |
c |
The import task has completed. |