net~ NodeInstructionUrlHelperMixin

A mixin class that adds SolarNode instruction support to module:net~UrlHelper.

Methods

queueInstructionUrl(topic, parametersopt, nodeIdopt) → {string}

Generate a URL for posting an instruction request.

Parameters:
NameTypeAttributesDescription
topicstring

the instruction topic

parametersArray.<Object><optional>

an array of parameter objects in the form {name:n1, value:v1}

nodeIdnumber<optional>

a specific node ID to use; if not provided the nodeId property of this class will be used

Returns:

the URL

Type: 
string

queueInstructionsUrl(topic, parametersopt, nodeIdsopt) → {string}

Generate a URL for posting instruction requests for multiple nodes.

Parameters:
NameTypeAttributesDescription
topicstring

the instruction topic

parametersArray.<Object><optional>

an array of parameter objects in the form {name:n1, value:v1}

nodeIdsArray.<number><optional>

a list of node IDs to use; if not provided the nodeIds property of this class will be used

Returns:

the URL

Type: 
string

updateInstructionStateUrl(instructionId, state) → {string}

Generate a URL for changing the state of an instruction.

Parameters:
NameTypeDescription
instructionIdnumber

the instruction ID to update

stateInstructionState

the instruction state to set

See
  • the InstructionStates enum for possible state values
Returns:

the URL

Type: 
string

urlEncodeInstructionParameters(parametersopt) → {string}

Generate URL encoded query string for posting instruction parameters.

Parameters:
NameTypeAttributesDescription
parametersArray.<Object><optional>

an array of parameter objects in the form {name:n1, value:v1}

Returns:

the URL encoded query string, or an empty string if parameters is empty

Type: 
string

viewActiveInstructionsUrl(nodeIdopt) → {string}

Generate a URL for viewing active instructions.

Parameters:
NameTypeAttributesDescription
nodeIdnumber<optional>

a specific node ID to use; if not provided the nodeId property of this class will be used

Returns:

the URL

Type: 
string

viewInstructionUrl(instructionId) → {string}

Generate a URL to get all details for a specific instruction.

Parameters:
NameTypeDescription
instructionIdnumber

the instruction ID to get

Returns:

the URL

Type: 
string

viewPendingInstructionsUrl(nodeIdopt) → {string}

Generate a URL for viewing pending instructions.

Parameters:
NameTypeAttributesDescription
nodeIdnumber<optional>

a specific node ID to use; if not provided the nodeId property of this class will be used

Returns:

the URL

Type: 
string

(static) instructionParameter(name, value) → {object}

Create an instruction parameter suitable to passing to NodeInstructionUrlHelperMixin#queueInstructionUrl.

Parameters:
NameTypeDescription
namestring

the parameter name

value*

the parameter value

Returns:

with name and value properties

Type: 
object