Commands for devices
When we invoke the wladm program, we can include various commands for devices.
The list devices command
The list devices command returns the list of devices that have contacted the apps of a runtime.
Syntax:
list devices [runtime-name] [--query query]
It takes the following arguments:
The query parameter specifies a string to search for. All devices that have a friendly name or user identifier containing this string (with case-insensitive matching) are returned.
Argument Description runtime-name Name of the runtime web application / MobileFirst project. query A friendly name or user identifier, to search for. It takes the following options after the object:
Examples:
Option Description --xml Produce XML output instead of tabular output.
list-devices worklight list-devices worklight --query=johnThis command is based on the Devices (GET) REST service.
The remove device command
The remove device command clears the record about a device that has contacted the apps of a runtime.
Syntax:
remove device [runtime-name] id
It takes the following arguments:
Argument Description runtime-name Name of the runtime web application / MobileFirst project. id Unique device identifier. Example:
remove device worklight 496E974CCEDE86791CF9A8EF2E5145B6
This command is based on the Device (DELETE) REST service.
The device command prefix
The device command prefix takes the following arguments before the verb:
Argument Description runtime-name Name of the runtime web application / MobileFirst project. id Unique device identifier.
The device set status command
The device set status command changes the status of a device, in the scope of a runtime.
Syntax:
device [runtime-name] id set status new-status
It takes the following arguments:
The status can be:
Argument Description new-status New status.
- ACTIVE
- LOST
- STOLEN
- EXPIRED
- DISABLED
Example:
device worklight 496E974CCEDE86791CF9A8EF2E5145B6 set status EXPIRED
This command is based on the Device Status (PUT) REST service.
The device set appstatus command
The device set appstatus command changes the status of a device, regarding an app in a runtime.
Syntax:
device [runtime-name] id set appstatus app-name new-status
It takes the following arguments:
The status can be:
Argument Description app-name Name of an app. new-status New status.
- ENABLED
- DISABLED
Example:
device worklight 496E974CCEDE86791CF9A8EF2E5145B6 set appstatus MyApp DISABLED
This command is based on the Device Application Status (PUT) REST service.
Parent topic: Administer MobileFirst applications through the command line