For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Commands for devices
When we call the mfpadm Ant task, 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. It has the following attributes:
Table 1. list-devices command attributes Attribute Description Required Default runtime Name of the runtime. Yes Not available query A friendly name or user identifier to search for. This 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. No Not applicable output Name of output file. No Not applicable outputproperty Name of Ant property for the output. No Not applicable
Examples
<list-devices runtime="mfp"/>
<list-devices runtime="mfp" 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. Yes Not available id Unique device identifier. Yes Not available
Example
<remove-device runtime="mfp" 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. Yes Not available id Unique device identifier. Yes Not available The device command 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:
The status can have one of the following values:
Table 5. set-status command attributes Attribute Description Required Default status New status. Yes Not available
- ACTIVE
- LOST
- STOLEN
- EXPIRED
- DISABLED
Example
<device runtime="mfp" 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:
The status can have one of the following values:
Table 6. set-appstatus command attributes Attribute Description Required Default app Name of an app. Yes Not available status New status. Yes Not available
- ENABLED
- DISABLED
Example
<device runtime="mfp" id="496E974CCEDE86791CF9A8EF2E5145B6"> <set-appstatus app="MyApp" status="DISABLED"/> </device>
This command is based on the Device Application Status (PUT) REST service.
Parent topic: Administering MobileFirst applications through Ant