AndroidInstances resource provides methods to create, list, retrieve, and delete Android instances.
Methods
create()
Create a new Android instance.Parameters
If there is another instance with given labels and region, return that one instead of creating a new instance.
Return after the instance is ready to connect.
Specification for the Android instance.
The region where the instance will be created. If not given, will be decided based on scheduling clues and availability.
After how many minutes of inactivity should the instance be terminated. Example values:
"1m", "10m", "3h". Default is "3m". Providing "0" disables inactivity checks altogether.After how many minutes should the instance be terminated. Example values:
"1m", "10m", "3h". Default is "0" which means no hard timeout.Scheduling clues to help determine optimal instance placement.Each clue object has:
kind:"ClientIP"or"OSVersion"clientIp: IP address (when kind is"ClientIP")osVersion: Major Android version like"13","14", or"15"(when kind is"OSVersion")
Assets to load when the instance starts.Each asset object has:
kind:"App"or"Configuration"source:"URL","URLs","AssetName","AssetNames", or"AssetIDs"url: Single URL (when source is"URL")urls: Multiple URLs (when source is"URLs")assetName: Asset name (when source is"AssetName")assetNames: Multiple asset names (when source is"AssetNames")assetIds: Asset IDs (when source is"AssetIDs")configuration: Configuration object for kind"Configuration"
Returns
Unique identifier for the instance.
ISO 8601 timestamp when the instance was created.
Organization ID that owns this instance.
Human-readable display name.
Key-value labels attached to the instance.
ISO 8601 timestamp when the instance was terminated.
Authentication token for connecting to the instance.
Current state:
"unknown", "creating", "assigned", "ready", or "terminated".WebSocket URL for ADB connection.
WebSocket URL for endpoint connection.
URL prefix for accessing HTTP ports on the instance.
Error message if the instance failed.
Example
list()
List Android instances with optional filters.Parameters
Labels filter to apply to Android instances to return. Expects a comma-separated list of key=value pairs (e.g.,
"env=prod,region=us-west").Region where the instance is scheduled on.
State filter to apply to Android instances to return. Each comma-separated state will be used as part of an OR clause, e.g.
"assigned,ready" will return all instances that are either assigned or ready.Valid states: "creating", "assigned", "ready", "terminated", "unknown"Number of items per page.
Token for pagination.
Returns
Returns a paginated list ofAndroidInstance objects.
Example
get()
Get an Android instance by ID.Parameters
The unique identifier of the Android instance.
Returns
Returns anAndroidInstance object with the same structure as described in the create() method.
Example
delete()
Delete an Android instance.Parameters
The unique identifier of the Android instance to delete.