Commands and Command Formats
Command formats for protobuf objects sent to Predix Machine and returned to the Cloud Gateway.
- EdgeCommand Protobuf Object sent to Machine
-
{ "id": "Command ID", "commandHandlerType": "Command Handler Name/Type", "appName": "Name of the Container this command is intended for", "command": "Command to execute", "url": "URL to post output", "params":{ "Command parameter (i.e. PollingTime)": "Value (i.e. 30)" } }
- CommandStatus Protobuf Object returned to CloudGateway
-
{ "taskId": "ID found in EdgeCommand received by Machine Command Handler", "status": "Status of type TaskStatus", "statusMessage": "Status Message", "statusDetailedMessage": "Status Detailed Message", "output": "Command String Output up to size 1KB. If output is returned through this status object, the output uploaded with the provided URL will be ignored." }
Commands
The following commands are provided by the Predix Edge Command Handler.
Display Name | Command | Parameters | Operation Description |
---|---|---|---|
Predix Machine: Refresh | refresh | Restarts the Predix Edge OSGi container. | |
Predix Machine: Restart | restart | Restarts the Predix Edge OSGi container process. This command is not permitted if the watchdog is not running. | |
Predix Machine: Upload Configurations | uploadconfig | Uploads the current machine configuration files. | |
HTTP Tunnel: Enable | enablehttptunnel | Enables the Http Tunnel Client. | |
HTTP Tunnel: Disable | disablehttptunnel | Disables the Http Tunnel Client. | |
Technician Console: Enable | enableweb | Enables the Technician Console and restarts the container. | |
Technician Console: Disable | disableweb | Disables the Technician Console and restarts the container. | |
Predix Machine: Get Log | getlogs | File Name: "machine:/machine/machine.log" | Posts the specified log file from the Predix Edge OSGi Container to a predefined URL endpoint in device manager. If no name is specified, the current log file is posted. Log files follow a URI format: <application_name>:/<path_to_file>. The default application is machine, which posts machine.log. Other applications in containers can be referenced using the scheme portion of the URI. |
Predix Machine: Set Polling Interval | setpolling | Polling Interval Time: 30 |
Sets the device manager polling interval to the value passed. This sets the configuration file: com.ge.dspmicro.cloud.gateway.config |
Predix Machine: Get IP Address | ipaddress | Posts the network interface information with all available device IP addresses to the provided URL endpoint. Following is a sample format, which will be in the POST body of the return call:
| |
Predix Machine: Get Available Logs | get_available_logs | Returns a list of available logs on the machine. The format provides a URI. The scheme in the URI indicates which application the log pertains to and the path indicates which log file in that application. For all Predix Machine logs, the root of the path begins in the machine log folder. The following contents will be in the POST body of the return call.
| |
Predix Machine: List installed packages | run_dpkg | Lists all packages installed on the device. Note: Only for Linux devices that support dpkg. | |
Predix Machine: Run ifconfig command | run_ifconfig | Runs the system command ifconfig on the device and returns the command output. Note: This applies only to devices that support the ifconfig command. | |
Predix Machine: Run top command | run_top | Runs the system command top on the device for one iteration. Note: This applies only to devices that support the top command. | |
Predix Machine: Run journalctl command | run_journalctl | Filtering parameters include:
Output Format parameters include:
| Uses system command journalctl to query the default system journal on the device according to the filtering and formatting values specified in the command parameters. All command parameters are optional. However, journals usually contain a lot of entries, therefore, it is best practice to use the filtering parameters to reduce the size of the output to send to the cloud. Note: Only for Linux devices that support journalctl. |
Predix Machine: Refresh Device Detail | refresh_device_detail | Sends all device detail information in the next sync. This command overrides the Cloud Gateway's polling interval (com.ge.dspmicro.cloud.gateway.pollingInterval ) and schedules a sync immediately.This command also overrides the sync intervals of the following device detail categories. Information about the following, together with all other available device detail information, will be included in the next sync.
|
Command Output
CommandStatus
object (first way) will be displayed in the Edge Manager UI. - Output is sent through the
CommandStatus
object in theOutput
field.Note: This is limited to String output of size < 1KB. - Output is uploaded through the provided URL.