Skip to main content
Version: 2.8

Command Access

The command handling manages the execution of commands. Commands cannot be added directly by the web service as they are managed by devices and their drivers.

Get All Commands

Gets a list of commands.

HTTP MethodGET
HTTP Url:nodes/command
HTTP Query-Parameter:-
Request Content-Typetext/xml; text/json
Request Body-
Response Content-Typetext/xml; text/json
Response ContentCommand argument list

Example:

GET http://localhost:8081/nodes/command?id=f9a4300a-654b-42cf-9f54-f866184b7352

Get a Single Command

Gets the arguments and description of a command.

HTTP MethodGET
HTTP Url:nodes/command
HTTP Query-Parameter:“id”: command id as System.Guid
Request Content-Typetext/xml; text/json
Request Body-
Response Content-Typetext/xml; text/json
Response ContentCommand argument list

Example:

GET http://localhost:8081/nodes/command?id=f9a4300a-654b-42cf-9f54-f866184b7352

Response Body

<HumanOS.Stream>
<Command>
<Id>624771e2-7146-49b4-b13f-4876decada37</Id>
<Name>MyCommand</Name>
<Property>
<Name>ScriptFileName</Name>
<DataType>System.String</DataType>
<Value>TCommand_MyScript.cs</Value>
</Property>
<Argument name="Arg1" datatype="System.String" calltype="Input" description="First Argument"/>
<Argument name="Arg2" datatype="System.Int32" calltype="Input" description="Second Argument"/>
<Argument name="Retval" datatype="System.String" calltype="Output" description="Output"/>
</Command>
</HumanOS.Stream>

Executing Commands

Lists nodes within a specific group.

HTTP MethodPOST
HTTP Url:nodes/command
HTTP Query-Parameter:id: command id as System.Guid
Request Content-Typetext/xml; text/json
Request BodyCommand arguments
Response Content-Typetext/xml; text/json
Response ContentResult of the command including return codes and exceptions

The argument list must match exactly to the command node arguments. Use the GET url to receive the list of arguments for a specific call before executing the command.

Example:

Request Body:

<HumanOS.Stream>
<Command>
<Argument name="Arg1" datatype="System.String">Content string</Argument>
<Argument name="Arg2" datatype="System.Int32">-982</Argument>
</Command>
</HumanOS.Stream>
POST http://localhost:8081/nodes/command?id=f9a4300a-654b-42cf-9f54-f866184b7352

Response Body:

<HumanOS.Stream>
<Command>
<Argument name="Retval" datatype="System.String">Out value</Argument>
<ReturnCode>Good</ReturnCode>
<Exception></Exception>
</Command>
</HumanOS.Stream>

Return Codes

Following codes are returned:

Return CodeMeaning
GoodResult is good
GoodInProgressResult not available yet. Processing is in progress
BadAccessDeniedAccess denied
BadAddressInvalid source address
BadArgumentsInvalid arguments
BadConnectionNo connection to the source or target object
BadDataData not available
BadProcessingResult is bad. Not processed
BadLockedProcessing state is locked due to previous errors
BadFatalErrorFatal error
BadNotSupportedNot supported functionality
BadNotImplementedFunctionality not implemented
BadOutOfMemoryOut of memory
BadNotActiveData point not active
UncertainUncertain result, e.g. after interrupting a process