Open documentation ↗Overview
Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.
Cloud Spanner API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 39 endpoints.
At a glance
- Authentication
- OAuth
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Analytics
- Base URL
https://spanner.googleapis.com/- Version
- v1
- Endpoints
- 39
- OpenAPI
- Specification ↗
- Spec updated
- 2023-04-21
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://spanner.googleapis.com/v1/DATABASE/ddl" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://spanner.googleapis.com/v1/DATABASE/ddl", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"https://spanner.googleapis.com/v1/DATABASE/ddl",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| DELETE | /v1/{database} | Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`. Note: Cloud Spanner might co |
| GET | /v1/{database}/ddl | Returns 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 usi |
| PATCH | /v1/{database}/ddl | Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name |
| GET | /v1/{database}/sessions | Lists all sessions in a given database. |
| POST | /v1/{database}/sessions | 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 f |
| POST | /v1/{database}/sessions:batchCreate | 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 |
| GET | /v1/{name} | Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. |
| PATCH | /v1/{name} | Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the database. If the named database does not |
| DELETE | /v1/{name} | Deletes 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 th |
| GET | /v1/{name}/scans | Request a specific scan with Database-specific data for Cloud Key Visualizer. |
| POST | /v1/{name}:cancel | Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the serv |
| GET | /v1/{parent} | Return available scans given a Database-specific resource name. |
| GET | /v1/{parent}/backupOperations | Lists the backup long-running operations in the given instance. A backup operation has a name of the form `projects//instances//backups//operations/`. The long- |
| GET | /v1/{parent}/backups | Lists completed and pending backups. Backups returned are ordered by `create_time` in descending order, starting from the most recent `create_time`. |
| POST | /v1/{parent}/backups | Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format `projects//instances//backups//operations/ |
| POST | /v1/{parent}/backups:copy | Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format `projects//instances//backups//operations/` and |
| GET | /v1/{parent}/databaseOperations | Lists database longrunning-operations. A database operation has a name of the form `projects//instances//databases//operations/`. The long-running operation met |
| GET | /v1/{parent}/databaseRoles | Lists Cloud Spanner database roles. |
| GET | /v1/{parent}/databases | Lists Cloud Spanner databases. |
| POST | /v1/{parent}/databases | Creates a new Cloud Spanner database and starts to prepare it for serving. The returned long-running operation will have a name of the format `/operations/` and |
| POST | /v1/{parent}/databases:restore | Create 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 configuration |
| GET | /v1/{parent}/instanceConfigOperations | Lists the user-managed instance config long-running operations in the given project. An instance config operation has a name of the form `projects//instanceConf |
| GET | /v1/{parent}/instanceConfigs | Lists the supported instance configurations for a given project. |
| POST | /v1/{parent}/instanceConfigs | Creates an instance config and begins preparing it to be used. The returned long-running operation can be used to track the progress of preparing the new instan |
| GET | /v1/{parent}/instances | Lists all instances in the given project. |
| POST | /v1/{parent}/instances | Creates 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 instanc |
| POST | /v1/{resource}:getIamPolicy | Gets 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. Authori |
| POST | /v1/{resource}:setIamPolicy | Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` permissio |
| POST | /v1/{resource}:testIamPermissions | Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result i |
| POST | /v1/{session}:beginTransaction | Begins a new transaction. This step can often be skipped: Read, ExecuteSql and Commit can begin a new transaction as a side-effect. |
| POST | /v1/{session}:commit | Commits 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 |
| POST | /v1/{session}:executeBatchDml | Executes a batch of SQL DML statements. This method allows many statements to be run with lower latency than submitting them sequentially with ExecuteSql. State |
| POST | /v1/{session}:executeSql | Executes an SQL statement, returning all results in a single reply. This method cannot be used to return a result set larger than 10 MiB; if the query yields mo |
| POST | /v1/{session}:executeStreamingSql | Like 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 individual |
| POST | /v1/{session}:partitionQuery | Creates 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 ExecuteStreami |
| POST | /v1/{session}:partitionRead | Creates 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 t |
| POST | /v1/{session}:read | Reads rows from the database using key lookups and scans, as a simple key/value style alternative to ExecuteSql. This method cannot be used to return a result s |
| POST | /v1/{session}:rollback | Rolls back a transaction, releasing any locks it holds. It is a good idea to call this for any transaction that includes one or more Read or ExecuteSql requests |
| POST | /v1/{session}:streamingRead | Like 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 r |
Questions
Does the Cloud Spanner API API need an API key?
Yes. The Cloud Spanner API API uses OAuth authentication; the documentation explains how to get credentials.
Does the Cloud Spanner API API support HTTPS?
Yes, the Cloud Spanner API API is served over HTTPS.
How many endpoints does the Cloud Spanner API API have?
Its OpenAPI description lists 39 endpoints in version v1. All of them are shown on this page.
What are alternatives to the Cloud Spanner API API?
Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.
Similar analytics APIs
Compare alternatives →Google Play Integrity API
AnalyticsThe Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.
versionhistory.googleapis.com API
AnalyticsVersion History API - Prod
Doc Converter
AnalyticsThis api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)
Perspective Comment Analyzer API
AnalyticsThe Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.
Safe Browsing API
AnalyticsEnables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.
Web Fonts Developer API
AnalyticsThe Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.
Listed from APIs.guru (CC0).