DeviceFarm / Client / list_devices
list_devices#
- DeviceFarm.Client.list_devices(**kwargs)#
Gets information about unique device types.
See also: AWS API Documentation
Request Syntax
response = client.list_devices( arn='string', nextToken='string', filters=[ { 'attribute': 'ARN'|'PLATFORM'|'OS_VERSION'|'MODEL'|'AVAILABILITY'|'FORM_FACTOR'|'MANUFACTURER'|'REMOTE_ACCESS_ENABLED'|'REMOTE_DEBUG_ENABLED'|'INSTANCE_ARN'|'INSTANCE_LABELS'|'FLEET_TYPE', 'operator': 'EQUALS'|'LESS_THAN'|'LESS_THAN_OR_EQUALS'|'GREATER_THAN'|'GREATER_THAN_OR_EQUALS'|'IN'|'NOT_IN'|'CONTAINS', 'values': [ 'string', ] }, ] )
- Parameters:
arn (string) – The Amazon Resource Name (ARN) of the project.
nextToken (string) – An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
filters (list) –
Used to select a set of devices. A filter is made up of an attribute, an operator, and one or more values.
Attribute: The aspect of a device such as platform or model used as the selection criteria in a device filter. Allowed values include:
ARN: The Amazon Resource Name (ARN) of the device (for example,
arn:aws:devicefarm:us-west-2::device:12345Example
).PLATFORM: The device platform. Valid values are ANDROID or IOS.
OS_VERSION: The operating system version (for example, 10.3.2).
MODEL: The device model (for example, iPad 5th Gen).
AVAILABILITY: The current availability of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.
FORM_FACTOR: The device form factor. Valid values are PHONE or TABLET.
MANUFACTURER: The device manufacturer (for example, Apple).
REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote access. Valid values are TRUE or FALSE.
REMOTE_DEBUG_ENABLED: Whether the device is enabled for remote debugging. Valid values are TRUE or FALSE. Because remote debugging is no longer supported, this attribute is ignored.
INSTANCE_ARN: The Amazon Resource Name (ARN) of the device instance.
INSTANCE_LABELS: The label of the device instance.
FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE.
Operator: The filter operator.
The EQUALS operator is available for every attribute except INSTANCE_LABELS.
The CONTAINS operator is available for the INSTANCE_LABELS and MODEL attributes.
The IN and NOT_IN operators are available for the ARN, OS_VERSION, MODEL, MANUFACTURER, and INSTANCE_ARN attributes.
The LESS_THAN, GREATER_THAN, LESS_THAN_OR_EQUALS, and GREATER_THAN_OR_EQUALS operators are also available for the OS_VERSION attribute.
Values: An array of one or more filter values.
The IN and NOT_IN operators take a values array that has one or more elements.
The other operators require an array with a single element.
In a request, the AVAILABILITY attribute takes the following values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.
(dict) –
Represents a device filter used to select a set of devices to be included in a test run. This data structure is passed in as the
deviceSelectionConfiguration
parameter toScheduleRun
. For an example of the JSON request syntax, see ScheduleRun.It is also passed in as the
filters
parameter toListDevices
. For an example of the JSON request syntax, see ListDevices.attribute (string) – [REQUIRED]
The aspect of a device such as platform or model used as the selection criteria in a device filter.
The supported operators for each attribute are provided in the following list.
ARN
The Amazon Resource Name (ARN) of the device (for example,
arn:aws:devicefarm:us-west-2::device:12345Example
).Supported operators:
EQUALS
,IN
,NOT_IN
PLATFORM
The device platform. Valid values are ANDROID or IOS.
Supported operators:
EQUALS
OS_VERSION
The operating system version (for example, 10.3.2).
Supported operators:
EQUALS
,GREATER_THAN
,GREATER_THAN_OR_EQUALS
,IN
,LESS_THAN
,LESS_THAN_OR_EQUALS
,NOT_IN
MODEL
The device model (for example, iPad 5th Gen).
Supported operators:
CONTAINS
,EQUALS
,IN
,NOT_IN
AVAILABILITY
The current availability of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.
Supported operators:
EQUALS
FORM_FACTOR
The device form factor. Valid values are PHONE or TABLET.
Supported operators:
EQUALS
MANUFACTURER
The device manufacturer (for example, Apple).
Supported operators:
EQUALS
,IN
,NOT_IN
REMOTE_ACCESS_ENABLED
Whether the device is enabled for remote access. Valid values are TRUE or FALSE.
Supported operators:
EQUALS
REMOTE_DEBUG_ENABLED
Whether the device is enabled for remote debugging. Valid values are TRUE or FALSE.
Supported operators:
EQUALS
Because remote debugging is no longer supported, this filter is ignored.
INSTANCE_ARN
The Amazon Resource Name (ARN) of the device instance.
Supported operators:
EQUALS
,IN
,NOT_IN
INSTANCE_LABELS
The label of the device instance.
Supported operators:
CONTAINS
FLEET_TYPE
The fleet type. Valid values are PUBLIC or PRIVATE.
Supported operators:
EQUALS
operator (string) – [REQUIRED]
Specifies how Device Farm compares the filter’s attribute to the value. See the attribute descriptions.
values (list) – [REQUIRED]
An array of one or more filter values used in a device filter.
Operator Values
The IN and NOT_IN operators can take a values array that has more than one element.
The other operators require an array with a single element.
Attribute Values
The PLATFORM attribute can be set to ANDROID or IOS.
The AVAILABILITY attribute can be set to AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.
The FORM_FACTOR attribute can be set to PHONE or TABLET.
The FLEET_TYPE attribute can be set to PUBLIC or PRIVATE.
(string) –
- Return type:
dict
- Returns:
Response Syntax
{ 'devices': [ { 'arn': 'string', 'name': 'string', 'manufacturer': 'string', 'model': 'string', 'modelId': 'string', 'formFactor': 'PHONE'|'TABLET', 'platform': 'ANDROID'|'IOS', 'os': 'string', 'cpu': { 'frequency': 'string', 'architecture': 'string', 'clock': 123.0 }, 'resolution': { 'width': 123, 'height': 123 }, 'heapSize': 123, 'memory': 123, 'image': 'string', 'carrier': 'string', 'radio': 'string', 'remoteAccessEnabled': True|False, 'remoteDebugEnabled': True|False, 'fleetType': 'string', 'fleetName': 'string', 'instances': [ { 'arn': 'string', 'deviceArn': 'string', 'labels': [ 'string', ], 'status': 'IN_USE'|'PREPARING'|'AVAILABLE'|'NOT_AVAILABLE', 'udid': 'string', 'instanceProfile': { 'arn': 'string', 'packageCleanup': True|False, 'excludeAppPackagesFromCleanup': [ 'string', ], 'rebootAfterUse': True|False, 'name': 'string', 'description': 'string' } }, ], 'availability': 'TEMPORARY_NOT_AVAILABLE'|'BUSY'|'AVAILABLE'|'HIGHLY_AVAILABLE' }, ], 'nextToken': 'string' }
Response Structure
(dict) –
Represents the result of a list devices operation.
devices (list) –
Information about the devices.
(dict) –
Represents a device type that an app is tested against.
arn (string) –
The device’s ARN.
name (string) –
The device’s display name.
manufacturer (string) –
The device’s manufacturer name.
model (string) –
The device’s model name.
modelId (string) –
The device’s model ID.
formFactor (string) –
The device’s form factor.
Allowed values include:
PHONE
TABLET
platform (string) –
The device’s platform.
Allowed values include:
ANDROID
IOS
os (string) –
The device’s operating system type.
cpu (dict) –
Information about the device’s CPU.
frequency (string) –
The CPU’s frequency.
architecture (string) –
The CPU’s architecture (for example, x86 or ARM).
clock (float) –
The clock speed of the device’s CPU, expressed in hertz (Hz). For example, a 1.2 GHz CPU is expressed as 1200000000.
resolution (dict) –
The resolution of the device.
width (integer) –
The screen resolution’s width, expressed in pixels.
height (integer) –
The screen resolution’s height, expressed in pixels.
heapSize (integer) –
The device’s heap size, expressed in bytes.
memory (integer) –
The device’s total memory size, expressed in bytes.
image (string) –
The device’s image name.
carrier (string) –
The device’s carrier.
radio (string) –
The device’s radio.
remoteAccessEnabled (boolean) –
Specifies whether remote access has been enabled for the specified device.
remoteDebugEnabled (boolean) –
This flag is set to
true
if remote debugging is enabled for the device.Remote debugging is no longer supported.
fleetType (string) –
The type of fleet to which this device belongs. Possible values are PRIVATE and PUBLIC.
fleetName (string) –
The name of the fleet to which this device belongs.
instances (list) –
The instances that belong to this device.
(dict) –
Represents the device instance.
arn (string) –
The Amazon Resource Name (ARN) of the device instance.
deviceArn (string) –
The ARN of the device.
labels (list) –
An array of strings that describe the device instance.
(string) –
status (string) –
The status of the device instance. Valid values are listed here.
udid (string) –
Unique device identifier for the device instance.
instanceProfile (dict) –
A object that contains information about the instance profile.
arn (string) –
The Amazon Resource Name (ARN) of the instance profile.
packageCleanup (boolean) –
When set to
true
, Device Farm removes app packages after a test run. The default value isfalse
for private devices.excludeAppPackagesFromCleanup (list) –
An array of strings containing the list of app packages that should not be cleaned up from the device after a test run completes.
The list of packages is considered only if you set
packageCleanup
totrue
.(string) –
rebootAfterUse (boolean) –
When set to
true
, Device Farm reboots the instance after a test run. The default value istrue
.name (string) –
The name of the instance profile.
description (string) –
The description of the instance profile.
availability (string) –
Indicates how likely a device is available for a test run. Currently available in the ListDevices and GetDevice API methods.
nextToken (string) –
If the number of items that are returned is significantly large, this is an identifier that is also returned. It can be used in a subsequent call to this operation to return the next set of items in the list.
Exceptions
Examples
The following example returns information about the available devices in a specific project.
response = client.list_devices( # You can get the project ARN by using the list-projects CLI command. arn='arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456', ) print(response)
Expected Output:
{ 'ResponseMetadata': { '...': '...', }, }