device_sessions
Creates, updates, deletes, gets or lists a device_sessions
resource.
Overview
Name | device_sessions |
Type | Resource |
Id | google.testing.device_sessions |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Optional. Name of the DeviceSession, e.g. "projects/{project_id}/deviceSessions/{session_id}" |
activeStartTime | string | Output only. The timestamp that the session first became ACTIVE. |
androidDevice | object | A single Android device. |
createTime | string | Output only. The time that the Session was created. |
displayName | string | Output only. The title of the DeviceSession to be presented in the UI. |
expireTime | string | Optional. If the device is still in use at this time, any connections will be ended and the SessionState will transition from ACTIVE to FINISHED. |
inactivityTimeout | string | Output only. The interval of time that this device must be interacted with before it transitions from ACTIVE to TIMEOUT_INACTIVITY. |
state | string | Output only. Current state of the DeviceSession. |
stateHistories | array | Output only. The historical state transitions of the session_state message including the current session state. |
ttl | string | Optional. The amount of time that a device will be initially allocated for. This can eventually be extended with the UpdateDeviceSession RPC. Default: 15 minutes. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | deviceSessionsId, projectsId | GET /v1/projects/{project_id}/deviceSessions/{device_session_id} Return a DeviceSession, which documents the allocation status and whether the device is allocated. Clients making requests from this API must poll GetDeviceSession. |
list | SELECT | projectsId | GET /v1/projects/{project_id}/deviceSessions Lists device Sessions owned by the project user. |
create | INSERT | projectsId | POST /v1/projects/{project_id}/deviceSessions |
patch | UPDATE | deviceSessionsId, projectsId | PATCH /v1/projects/{projectId}/deviceSessions/deviceSessionId}:updateDeviceSession Updates the current device session to the fields described by the update_mask. |
cancel | EXEC | deviceSessionsId, projectsId | POST /v1/projects/{project_id}/deviceSessions/{device_session_id}:cancel Changes the DeviceSession to state FINISHED and terminates all connections. Canceled sessions are not deleted and can be retrieved or listed by the user until they expire based on the 28 day deletion policy. |
SELECT
examples
GET /v1/projects/{project_id}/deviceSessions Lists device Sessions owned by the project user.
SELECT
name,
activeStartTime,
androidDevice,
createTime,
displayName,
expireTime,
inactivityTimeout,
state,
stateHistories,
ttl
FROM google.testing.device_sessions
WHERE projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new device_sessions
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.testing.device_sessions (
projectsId,
name,
ttl,
expireTime,
androidDevice
)
SELECT
'{{ projectsId }}',
'{{ name }}',
'{{ ttl }}',
'{{ expireTime }}',
'{{ androidDevice }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: displayName
value: string
- name: state
value: string
- name: stateHistories
value:
- - name: sessionState
value: string
- name: eventTime
value: string
- name: stateMessage
value: string
- name: ttl
value: string
- name: expireTime
value: string
- name: inactivityTimeout
value: string
- name: createTime
value: string
- name: activeStartTime
value: string
- name: androidDevice
value:
- name: androidModelId
value: string
- name: androidVersionId
value: string
- name: locale
value: string
- name: orientation
value: string
UPDATE
example
Updates a device_sessions
resource.
/*+ update */
UPDATE google.testing.device_sessions
SET
name = '{{ name }}',
ttl = '{{ ttl }}',
expireTime = '{{ expireTime }}',
androidDevice = '{{ androidDevice }}'
WHERE
deviceSessionsId = '{{ deviceSessionsId }}'
AND projectsId = '{{ projectsId }}';