Copyright | (c) 2015-2016 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Creates a new session. A session can be used to perform transactions that read and/or modify data in a Cloud Spanner database. Sessions are meant to be reused for many consecutive transactions. Sessions can only execute one transaction at a time. To execute multiple concurrent read-write/write-only transactions, create multiple sessions. Note that standalone reads and queries use a transaction internally, and count toward the one transaction limit. Cloud Spanner limits the number of sessions that can exist at any given time; thus, it is a good idea to delete idle and/or unneeded sessions. Aside from explicit deletes, Cloud Spanner can delete sessions for which no operations are sent for more than an hour. If a session is deleted, requests to it return `NOT_FOUND`. Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT 1"`.
See: Cloud Spanner API Reference for spanner.projects.instances.databases.sessions.create
.
Synopsis
- type ProjectsInstancesDatabasesSessionsCreateResource = "v1" :> (Capture "database" Text :> ("sessions" :> (QueryParam "$.xgafv" Xgafv :> (QueryParam "upload_protocol" Text :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "callback" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] CreateSessionRequest :> Post '[JSON] Session)))))))))
- projectsInstancesDatabasesSessionsCreate :: Text -> CreateSessionRequest -> ProjectsInstancesDatabasesSessionsCreate
- data ProjectsInstancesDatabasesSessionsCreate
- pXgafv :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Xgafv)
- pUploadProtocol :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text)
- pDatabase :: Lens' ProjectsInstancesDatabasesSessionsCreate Text
- pAccessToken :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text)
- pUploadType :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text)
- pPayload :: Lens' ProjectsInstancesDatabasesSessionsCreate CreateSessionRequest
- pCallback :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text)
REST Resource
type ProjectsInstancesDatabasesSessionsCreateResource = "v1" :> (Capture "database" Text :> ("sessions" :> (QueryParam "$.xgafv" Xgafv :> (QueryParam "upload_protocol" Text :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "callback" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] CreateSessionRequest :> Post '[JSON] Session))))))))) Source #
A resource alias for spanner.projects.instances.databases.sessions.create
method which the
ProjectsInstancesDatabasesSessionsCreate
request conforms to.
Creating a Request
projectsInstancesDatabasesSessionsCreate Source #
Creates a value of ProjectsInstancesDatabasesSessionsCreate
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
data ProjectsInstancesDatabasesSessionsCreate Source #
Creates a new session. A session can be used to perform transactions that read and/or modify data in a Cloud Spanner database. Sessions are meant to be reused for many consecutive transactions. Sessions can only execute one transaction at a time. To execute multiple concurrent read-write/write-only transactions, create multiple sessions. Note that standalone reads and queries use a transaction internally, and count toward the one transaction limit. Cloud Spanner limits the number of sessions that can exist at any given time; thus, it is a good idea to delete idle and/or unneeded sessions. Aside from explicit deletes, Cloud Spanner can delete sessions for which no operations are sent for more than an hour. If a session is deleted, requests to it return `NOT_FOUND`. Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT 1"`.
See: projectsInstancesDatabasesSessionsCreate
smart constructor.
Instances
Request Lenses
pUploadProtocol :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text) Source #
Upload protocol for media (e.g. "raw", "multipart").
pDatabase :: Lens' ProjectsInstancesDatabasesSessionsCreate Text Source #
Required. The database in which the new session is created.
pAccessToken :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text) Source #
OAuth access token.
pUploadType :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text) Source #
Legacy upload protocol for media (e.g. "media", "multipart").
pPayload :: Lens' ProjectsInstancesDatabasesSessionsCreate CreateSessionRequest Source #
Multipart request metadata.