REST Resource: projects.deviceSessions

Resource: DeviceSession

Protobuf message describing the device message, used from several RPCs.

JSON representation
{
  "name": string,
  "displayName": string,
  "state": enum (SessionState),
  "stateHistories": [
    {
      object (SessionStateEvent)
    }
  ],
  "inactivityTimeout": string,
  "createTime": string,
  "activeStartTime": string,
  "androidDevice": {
    object (AndroidDevice)
  },

  // Union field expiration can be only one of the following:
  "ttl": string,
  "expireTime": string
  // End of list of possible types for union field expiration.
}
Fields
name

string

Optional. Name of the DeviceSession, e.g. "projects/{projectId}/deviceSessions/{session_id}"

displayName

string

Output only. The title of the DeviceSession to be presented in the UI.

state

enum (SessionState)

Output only. Current state of the DeviceSession.

stateHistories[]

object (SessionStateEvent)

Output only. The historical state transitions of the sessionState message including the current session state.

inactivityTimeout

string (Duration format)

Output only. The interval of time that this device must be interacted with before it transitions from ACTIVE to TIMEOUT_INACTIVITY.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

createTime

string (Timestamp format)

Output only. The time that the Session was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

activeStartTime

string (Timestamp format)

Output only. The timestamp that the session first became ACTIVE.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

androidDevice

object (AndroidDevice)

Required. The requested device

Union field expiration.

expiration can be only one of the following:

ttl

string (Duration format)

Optional. The amount of time that a device will be initially allocated for. This can eventually be extended with the deviceSessions.patch RPC. Default: 15 minutes.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

expireTime

string (Timestamp format)

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.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

SessionState

The state that the device session resides.

Enums
SESSION_STATE_UNSPECIFIED Default value. This value is unused.
REQUESTED Initial state of a session request. The session is being validated for correctness and a device is not yet requested.
PENDING The session has been validated and is in the queue for a device.
ACTIVE The session has been granted and the device is accepting connections.
EXPIRED The session duration exceeded the device’s reservation time period and timed out automatically.
FINISHED The user is finished with the session and it was canceled by the user while the request was still getting allocated or after allocation and during device usage period.
UNAVAILABLE Unable to complete the session because the device was unavailable and it failed to allocate through the scheduler. For example, a device not in the catalog was requested or the request expired in the allocation queue.
ERROR Unable to complete the session for an internal reason, such as an infrastructure failure.

SessionStateEvent

A message encapsulating a series of Session states and the time that the DeviceSession first entered those states.

JSON representation
{
  "sessionState": enum (SessionState),
  "eventTime": string,
  "stateMessage": string
}
Fields
sessionState

enum (SessionState)

Output only. The sessionState tracked by this event

eventTime

string (Timestamp format)

Output only. The time that the sessionState first encountered that state.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

stateMessage

string

Output only. A human-readable message to explain the state.

Methods

cancel

POST /v1/projects/{project_id}/deviceSessions/{device_session_id}:cancel Changes the DeviceSession to state FINISHED and terminates all connections.

create

POST /v1/projects/{project_id}/deviceSessions

get

GET /v1/projects/{project_id}/deviceSessions/{device_session_id} Return a DeviceSession, which documents the allocation status and whether the device is allocated.

list

GET /v1/projects/{project_id}/deviceSessions Lists device Sessions owned by the project user.

patch

PATCH /v1/projects/{projectId}/deviceSessions/deviceSessionId}:updateDeviceSession Updates the current device session to the fields described by the update_mask.