Commands for devices

When you call the wladm Ant task, you 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. It has the following attributes:
Table 1. list-devices command attributes
Attribute Description Required Default
runtime Name of the runtime web application / MobileFirst project. Yes Not available
query A friendly name or user identifier to search for. No  
output Name of output file. No  
outputproperty Name of Ant property for the output. No  
The query parameter specifies a string to search for. All devices that have a friendly name or user identifier that contains this string (with case-insensitive matching) are returned.

Examples:

<list-devices runtime="worklight"/>

<list-devices runtime="worklight" query="john"/>

This 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. It has the following attributes:
Table 2. remove-device command attributes
Attribute Description Required Default
runtime Name of the runtime web application / MobileFirst project. Yes Not available
id Unique device identifier. Yes Not available

Example:

<remove-device runtime="worklight" id="496E974CCEDE86791CF9A8EF2E5145B6"/>

This command is based on the Device (DELETE) REST service.

The device command group

The device command group has the following attributes:
Table 3. device command group attributes
Attribute Description Required Default
runtime Name of the runtime web application / MobileFirst project. Yes Not available
id Unique device identifier. Yes Not available
It supports the following elements:
Table 4. device command group elements
Element Description Count
set-status Changes the status. 0..∞
set-appstatus Changes the status for an app. 0..∞

The set-status command

The set-status command changes the status of a device, in the scope of a runtime. It has the following attributes:
Table 5. set-status command attributes
Attribute Description Required Default
status New status. Yes Not available
The status can be one of:
  • ACTIVE
  • LOST
  • STOLEN
  • EXPIRED
  • DISABLED

Example:

<device runtime="worklight" id="496E974CCEDE86791CF9A8EF2E5145B6">
  <set-status status="EXPIRED"/>
</device>

This command is based on the Device Status (PUT) REST service.

The set-appstatus command

The set-appstatus command changes the status of a device, regarding an app in a runtime. It has the following attributes:
Table 6. set-appstatus command attributes
Attribute Description Required Default
app Name of an app. Yes Not available
status New status. Yes Not available
The status can be one of:
  • ENABLED
  • DISABLED

Example:

<device runtime="worklight" id="496E974CCEDE86791CF9A8EF2E5145B6">
  <set-appstatus app="MyApp" status="DISABLED"/>
</device>

This command is based on the Device Application Status (PUT) REST service.