Cloud Spanner API
Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.
Data & analytics#openapi#analytics#media
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.
Endpoints 50
projects.instanceConfigOperations
- GETLists the user-managed instance configuration long-running operations in the given project
/v1/:parent/instanceConfigOperations?filter=string&pageSize=0&pageToken=stringLists the user-managed instance configuration long-running operations in the given project. An instance configuration operation has a name of the form…
projects.instanceConfigs
- GETLists the supported instance configurations for a given project
/v1/:parent/instanceConfigs?pageSize=0&pageToken=stringLists the supported instance configurations for a given project. Returns both Google-managed configurations and user-managed configurations. - POSTCreates an instance configuration and begins preparing it to be used
/v1/:parent/instanceConfigsCreates an instance configuration and begins preparing it to be used. The returned long-running operation can be used to track the progress of preparing the…
projects.instances.operations
- GETLists operations that match the specified filter in the request
/v1/:name?filter=string&pageSize=0&pageToken=string&returnPartialSuccess=trueLists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. - DELETEDeletes a long-running operation
/v1/:nameDeletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If… - POSTStarts asynchronous cancellation on a long-running operation
/v1/:name:cancelStarts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the…
projects.instances.instancePartitions
- PATCHUpdates an instance partition, and begins allocating or releasing resources as requested
/v1/:nameUpdates an instance partition, and begins allocating or releasing resources as requested. The returned long-running operation can be used to track the… - GETLists all instance partitions for the given instance.
/v1/:parent/instancePartitions?instancePartitionDeadline=string&pageSize=0&pageToken=stringLists all instance partitions for the given instance. - POSTCreates an instance partition and begins preparing it to be used
/v1/:parent/instancePartitionsCreates an instance partition and begins preparing it to be used. The returned long-running operation can be used to track the progress of preparing the new…
projects.instances
- GETLists all instances in the given project.
/v1/:parent/instances?filter=string&instanceDeadline=string&pageSize=0&pageToken=stringLists all instances in the given project. - POSTCreates an instance and begins preparing it to begin serving
/v1/:parent/instancesCreates an instance and begins preparing it to begin serving. The returned long-running operation can be used to track the progress of preparing the new… - POSTMoves an instance to the target instance configuration
/v1/:name:moveMoves an instance to the target instance configuration. You can use the returned long-running operation to track the progress of moving the instance.…
projects.instances.databases.backupSchedules
- POSTGets the access control policy for a database or backup resource
/v1/:resource:getIamPolicyGets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.… - POSTSets the access control policy on a database or backup resource
/v1/:resource:setIamPolicySets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires spanner.databases.setIamPolicy… - GETLists all the backup schedules for the database.
/v1/:parent/backupSchedules?pageSize=0&pageToken=stringLists all the backup schedules for the database. - POSTCreates a new backup schedule.
/v1/:parent/backupSchedules?backupScheduleId=stringCreates a new backup schedule.
projects.instances.databases.databaseRoles
- POSTReturns permissions that the caller has on the specified database or backup resource
/v1/:resource:testIamPermissionsReturns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result… - GETLists Cloud Spanner database roles.
/v1/:parent/databaseRoles?pageSize=0&pageToken=stringLists Cloud Spanner database roles.
projects.instances.backupOperations
- GETLists the backup long-running operations in the given instance
/v1/:parent/backupOperations?filter=string&pageSize=0&pageToken=stringLists the backup long-running operations in the given instance. A backup operation has a name of the form projects//instances//backups//operations/. The…
projects.instances.backups
- POSTStarts copying a Cloud Spanner Backup
/v1/:parent/backups:copyStarts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format projects//instances//backups//operations/ and… - GETLists completed and pending backups
/v1/:parent/backups?filter=string&pageSize=0&pageToken=stringLists completed and pending backups. Backups returned are ordered by create_time in descending order, starting from the most recent create_time. - POSTStarts creating a new Cloud Spanner Backup
/v1/:parent/backups?backupId=string&encryptionConfig.encryptionType=ENCRYPTION_TYPE_UNSPECIFIED&encryptionConfig.kmsKeyName=string&encryptionConfig.kmsKeyNames=stringStarts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format…
projects.instances.databaseOperations
- GETLists database longrunning-operations
/v1/:parent/databaseOperations?filter=string&pageSize=0&pageToken=stringLists database longrunning-operations. A database operation has a name of the form projects//instances//databases//operations/. The long-running operation…
projects.instances.databases
- POSTAdds split points to specified tables and indexes of a database.
/v1/:database:addSplitPointsAdds split points to specified tables and indexes of a database. - POST`ChangeQuorum` is strictly restricted to databases that use dual-region instance configurations
/v1/:name:changequorumChangeQuorum is strictly restricted to databases that use dual-region instance configurations. Initiates a background operation to change the quorum of a… - GETLists Cloud Spanner databases.
/v1/:parent/databases?pageSize=0&pageToken=stringLists Cloud Spanner databases. - POSTCreates a new Spanner database and starts to prepare it for serving
/v1/:parent/databasesCreates a new Spanner database and starts to prepare it for serving. The returned long-running operation will have a name of the format /operations/ and can… - DELETEDrops (aka deletes) a Cloud Spanner database
/v1/:databaseDrops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their expire_time. Note: Cloud Spanner might… - GETReturns the schema of a Cloud Spanner database as a list of formatted DDL statements
/v1/:database/ddlReturns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried… - PATCHUpdates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc
/v1/:database/ddlUpdates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a… - GETRequest a specific scan with Database-specific data for Cloud Key Visualizer.
/v1/:name/scans?endTime=string&startTime=string&view=VIEW_UNSPECIFIEDRequest a specific scan with Database-specific data for Cloud Key Visualizer. - POSTCreate a new database by restoring from a completed backup
/v1/:parent/databases:restoreCreate a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance…
projects.instances.databases.sessions
- POSTHandles a single message from the client and returns the result as a stream
/v1/:name:adaptMessageHandles a single message from the client and returns the result as a stream. The server will interpret the message frame and respond with message frames to… - POSTCreates a new session to be used for requests made by the adapter
/v1/:parent/sessions:adapterCreates a new session to be used for requests made by the adapter. A session identifies a specific incarnation of a database resource and is meant to be… - POSTCreates multiple new sessions
/v1/:database/sessions:batchCreateCreates 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… - POSTBatches the supplied mutation groups in a collection of efficient transactions
/v1/:session:batchWriteBatches the supplied mutation groups in a collection of efficient transactions. All mutations in a group are committed atomically. However, mutations across… - POSTBegins a new transaction
/v1/:session:beginTransactionBegins a new transaction. This step can often be skipped: Read, ExecuteSql and Commit can begin a new transaction as a side-effect. - POSTCommits a transaction
/v1/:session:commitCommits a transaction. The request includes the mutations to be applied to rows in the database. Commit might return an ABORTED error. This can occur at any… - GETLists all sessions in a given database.
/v1/:database/sessions?filter=string&pageSize=0&pageToken=stringLists all sessions in a given database. - POSTCreates a new session
/v1/:database/sessionsCreates 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… - POSTExecutes a batch of SQL DML statements
/v1/:session:executeBatchDmlExecutes a batch of SQL DML statements. This method allows many statements to be run with lower latency than submitting them sequentially with ExecuteSql.… - POSTExecutes an SQL statement, returning all results in a single reply
/v1/:session:executeSqlExecutes an SQL statement, returning all results in a single reply. This method can't be used to return a result set larger than 10 MiB; if the query yields… - POSTLike ExecuteSql, except returns the result set as a stream
/v1/:session:executeStreamingSqlLike ExecuteSql, except returns the result set as a stream. Unlike ExecuteSql, there is no limit on the size of the returned result set. However, no… - POSTCreates a set of partition tokens that can be used to execute a query operation in parallel
/v1/:session:partitionQueryCreates a set of partition tokens that can be used to execute a query operation in parallel. Each of the returned partition tokens can be used by… - POSTCreates a set of partition tokens that can be used to execute a read operation in parallel
/v1/:session:partitionReadCreates a set of partition tokens that can be used to execute a read operation in parallel. Each of the returned partition tokens can be used by StreamingRead… - POSTReads rows from the database using key lookups and scans, as a simple key/value style alternative to ExecuteSql
/v1/:session:readReads rows from the database using key lookups and scans, as a simple key/value style alternative to ExecuteSql. This method can't be used to return a result… - POSTRolls back a transaction, releasing any locks it holds
/v1/:session:rollbackRolls back a transaction, releasing any locks it holds. It's a good idea to call this for any transaction that includes one or more Read or ExecuteSql… - POSTLike Read, except returns the result set as a stream
/v1/:session:streamingReadLike Read, except returns the result set as a stream. Unlike Read, there is no limit on the size of the returned result set. However, no individual row in the…
projects.instances.instancePartitionOperations
- GETLists instance partition long-running operations in the given instance
/v1/:parent/instancePartitionOperations?filter=string&instancePartitionDeadline=string&pageSize=0&pageToken=stringLists instance partition long-running operations in the given instance. An instance partition operation has a name of the form…
scans
- GETReturn available scans given a Database-specific resource name.
/v1/:parent?filter=string&pageSize=0&pageToken=string&view=VIEW_UNSPECIFIEDReturn available scans given a Database-specific resource name.
API details
- Base URL
https://spanner.googleapis.com- Authentication
- OAuth 2.0 (authorization code flow) with 3 scopes
An API key in the key query parameter - Operations
- 50 operations on 40 pathsPOST 30GET 16PATCH 2DELETE 2
- Main resources
- projects.instances.databases.sessions 16projects.instances.databases 9projects.instances.databases.backupSchedules 4projects.instances 3projects.instances.backups 3projects.instances.instancePartitions 3projects.instances.operations 3projects.instanceConfigs 2projects.instances.databases.databaseRoles 2projects.instanceConfigOperations 1
- Response formats
application/json- Description format
- Google API Discovery, API version
v1 - Links
- Documentation · OpenAPI document
- Listed from
- Google API Discovery document (googleapis/discovery-artifact-manager) (Apache-2.0)
How to test the Cloud Spanner API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the Cloud Spanner API collection, without the publisher's secrets.
- Add your credentialsThis API uses OAuth 2.0 (authorization code flow) with 3 scopes. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Lists the user-managed instance configuration long-running operations in the given project” (GET /v1/:parent/instanceConfigOperations?filter=string&pageSize=0&pageToken=string), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the Cloud Spanner API?
Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. It is listed under Data & analytics and has 50 endpoints.
Who publishes the Cloud Spanner API?
It is listed from Google's public API description (an OpenAPI document), not published by Google on Swastik Codes. Anyone who controls googleapis.com can claim the profile by adding a DNS TXT record.
What is the base URL of the Cloud Spanner API?
Requests go to https://spanner.googleapis.com. Endpoint paths are added to this base URL.
How do I authenticate with the Cloud Spanner API?
It accepts 2 methods: OAuth 2.0 (authorization code flow) with 3 scopes; an API key in the key query parameter.
How many endpoints does the Cloud Spanner API have?
50 operations on 40 paths (30 POST, 16 GET, 2 PATCH, 2 DELETE). The largest groups are projects.instances.databases.sessions, projects.instances.databases, projects.instances.databases.backupSchedules, projects.instances.
Is forking the Cloud Spanner API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.