REST Resource: projects.instances.databases.sessions

Resource: Session

A session in the Cloud Spanner API.

JSON representation
{
  "name": string,
  "labels": {
    string: string,
    ...
  },
  "createTime": string,
  "approximateLastUseTime": string,
}
Fields
name

string

The name of the session.

labels

map (key: string, value: string)

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)?.
  • No more than 64 labels can be associated with a given session.

See https://goo.gl/xmQnxf for more information on and examples of labels.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

createTime

string (Timestamp format)

Output only. The timestamp when the session is created.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

approximateLastUseTime

string (Timestamp format)

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

Methods

beginTransaction

Begins a new transaction.

commit

Commits a transaction.

create

Creates a new session.

delete

Ends a session, releasing server resources associated with it.

executeSql

Executes an SQL query, returning all rows in a single reply.

executeStreamingSql

Like ExecuteSql, except returns the result set as a stream.

get

Gets a session.

list

Lists all sessions in a given database.

read

Reads rows from the database using key lookups and scans, as a simple key/value style alternative to ExecuteSql.

rollback

Rolls back a transaction, releasing any locks it holds.

streamingRead

Like Read, except returns the result set as a stream.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Spanner Documentation