device_sessions
Creates, updates, deletes, gets or lists a device_sessions
resource.
Overview
Name | device_sessions |
Type | Resource |
Id | firebase.testing.device_sessions |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Optional. Name of the DeviceSession, e.g. "projects/{project_id}/deviceSessions/{session_id}" |
activeStartTime | string (google-datetime) | Output only. The timestamp that the session first became ACTIVE. |
androidDevice | object | A single Android device. (id: AndroidDevice) |
createTime | string (google-datetime) | 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 (google-datetime) | 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 (google-duration) | 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 (google-duration) | 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. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Optional. Name of the DeviceSession, e.g. "projects/{project_id}/deviceSessions/{session_id}" |
activeStartTime | string (google-datetime) | Output only. The timestamp that the session first became ACTIVE. |
androidDevice | object | A single Android device. (id: AndroidDevice) |
createTime | string (google-datetime) | 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 (google-datetime) | 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 (google-duration) | 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 (google-duration) | 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
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , deviceSessionsId | 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 | pageSize , pageToken , filter | 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 | projectsId , deviceSessionsId | updateMask | PATCH /v1/projects/{projectId}/deviceSessions/deviceSessionId}:updateDeviceSession Updates the current device session to the fields described by the update_mask. |
cancel | exec | projectsId , deviceSessionsId | 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. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
deviceSessionsId | string | |
projectsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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.
SELECT
name,
activeStartTime,
androidDevice,
createTime,
displayName,
expireTime,
inactivityTimeout,
state,
stateHistories,
ttl
FROM firebase.testing.device_sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND deviceSessionsId = '{{ deviceSessionsId }}' -- required;
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 firebase.testing.device_sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}';
INSERT
examples
- create
- Manifest
POST /v1/projects/{project_id}/deviceSessions
INSERT INTO firebase.testing.device_sessions (
data__name,
data__ttl,
data__expireTime,
data__androidDevice,
projectsId
)
SELECT
'{{ name }}',
'{{ ttl }}',
'{{ expireTime }}',
'{{ androidDevice }}',
'{{ projectsId }}'
RETURNING
name,
activeStartTime,
androidDevice,
createTime,
displayName,
expireTime,
inactivityTimeout,
state,
stateHistories,
ttl
;
# Description fields are for documentation purposes
- name: device_sessions
props:
- name: projectsId
value: string
description: Required parameter for the device_sessions resource.
- name: name
value: string
description: >
Optional. Name of the DeviceSession, e.g. "projects/{project_id}/deviceSessions/{session_id}"
- name: ttl
value: string
description: >
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.
- name: expireTime
value: string
description: >
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.
- name: androidDevice
value: object
description: >
A single Android device.
UPDATE
examples
- patch
PATCH /v1/projects/{projectId}/deviceSessions/deviceSessionId}:updateDeviceSession Updates the current device session to the fields described by the update_mask.
UPDATE firebase.testing.device_sessions
SET
data__name = '{{ name }}',
data__ttl = '{{ ttl }}',
data__expireTime = '{{ expireTime }}',
data__androidDevice = '{{ androidDevice }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND deviceSessionsId = '{{ deviceSessionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
activeStartTime,
androidDevice,
createTime,
displayName,
expireTime,
inactivityTimeout,
state,
stateHistories,
ttl;
Lifecycle Methods
- cancel
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.
EXEC firebase.testing.device_sessions.cancel
@projectsId='{{ projectsId }}' --required,
@deviceSessionsId='{{ deviceSessionsId }}' --required;