Creates multiple new sessions.
This API can be used to initialize a session cache on the clients. See https://goo.gl/TgSFN2 for best practices on session cache management.
HTTP request
POST https://spanner.googleapis.com/v1/{database=projects/*/instances/*/databases/*}/sessions:batchCreate
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
database |
Required. The database in which the new sessions are created. Authorization requires the following IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"sessionTemplate": {
object ( |
Fields | |
---|---|
session |
Parameters to be applied to each created session. |
session |
Required. The number of sessions to be created in this batch call. The API may return fewer than the requested number of sessions. If a specific number of sessions are desired, the client can make additional calls to sessions.batchCreate (adjusting |
Response body
The response for sessions.batchCreate
.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"session": [
{
object ( |
Fields | |
---|---|
session[] |
The freshly created sessions. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/spanner.data
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.