googleapis
Version:
Google APIs Client Library for Node.js
846 lines • 356 kB
TypeScript
/// <reference types="node" />
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace spanner_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Cloud Spanner API
*
* Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service.
*
* @example
* ```js
* const {google} = require('googleapis');
* const spanner = google.spanner('v1');
* ```
*/
export class Spanner {
context: APIRequestContext;
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* A backup of a Cloud Spanner database.
*/
export interface Schema$Backup {
/**
* Output only. The time the CreateBackup request is received. If the request does not specify `version_time`, the `version_time` of the backup will be equivalent to the `create_time`.
*/
createTime?: string | null;
/**
* Required for the CreateBackup operation. Name of the database from which this backup was created. This needs to be in the same instance as the backup. Values are of the form `projects//instances//databases/`.
*/
database?: string | null;
/**
* Output only. The encryption information for the backup.
*/
encryptionInfo?: Schema$EncryptionInfo;
/**
* Required for the CreateBackup operation. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 366 days from the time the CreateBackup request is processed. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
*/
expireTime?: string | null;
/**
* Output only for the CreateBackup operation. Required for the UpdateBackup operation. A globally unique identifier for the backup which cannot be changed. Values are of the form `projects//instances//backups/a-z*[a-z0-9]` The final segment of the name must be between 2 and 60 characters in length. The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form `projects//instances/`.
*/
name?: string | null;
/**
* Output only. The names of the restored databases that reference the backup. The database names are of the form `projects//instances//databases/`. Referencing databases may exist in different instances. The existence of any referencing database prevents the backup from being deleted. When a restored database from the backup enters the `READY` state, the reference to the backup is removed.
*/
referencingDatabases?: string[] | null;
/**
* Output only. Size of the backup in bytes.
*/
sizeBytes?: string | null;
/**
* Output only. The current state of the backup.
*/
state?: string | null;
/**
* The backup will contain an externally consistent copy of the database at the timestamp specified by `version_time`. If `version_time` is not specified, the system will set `version_time` to the `create_time` of the backup.
*/
versionTime?: string | null;
}
/**
* Information about a backup.
*/
export interface Schema$BackupInfo {
/**
* Name of the backup.
*/
backup?: string | null;
/**
* The time the CreateBackup request was received.
*/
createTime?: string | null;
/**
* Name of the database the backup was created from.
*/
sourceDatabase?: string | null;
/**
* The backup contains an externally consistent copy of `source_database` at the timestamp specified by `version_time`. If the CreateBackup request did not specify `version_time`, the `version_time` of the backup is equivalent to the `create_time`.
*/
versionTime?: string | null;
}
/**
* The request for BatchCreateSessions.
*/
export interface Schema$BatchCreateSessionsRequest {
/**
* 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 BatchCreateSessions (adjusting session_count as necessary).
*/
sessionCount?: number | null;
/**
* Parameters to be applied to each created session.
*/
sessionTemplate?: Schema$Session;
}
/**
* The response for BatchCreateSessions.
*/
export interface Schema$BatchCreateSessionsResponse {
/**
* The freshly created sessions.
*/
session?: Schema$Session[];
}
/**
* The request for BeginTransaction.
*/
export interface Schema$BeginTransactionRequest {
/**
* Required. Options for the new transaction.
*/
options?: Schema$TransactionOptions;
}
/**
* Associates `members` with a `role`.
*/
export interface Schema$Binding {
/**
* The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
*/
condition?: Schema$Expr;
/**
* Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid\}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid\}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid\}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid\}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid\}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid\}?uid={uniqueid\}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid\}` and the recovered group retains the role in the binding. * `domain:{domain\}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
*/
members?: string[] | null;
/**
* Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
*/
role?: string | null;
}
/**
* Metadata associated with a parent-child relationship appearing in a PlanNode.
*/
export interface Schema$ChildLink {
/**
* The node to which the link points.
*/
childIndex?: number | null;
/**
* The type of the link. For example, in Hash Joins this could be used to distinguish between the build child and the probe child, or in the case of the child being an output variable, to represent the tag associated with the output variable.
*/
type?: string | null;
/**
* Only present if the child node is SCALAR and corresponds to an output variable of the parent node. The field carries the name of the output variable. For example, a `TableScan` operator that reads rows from a table will have child links to the `SCALAR` nodes representing the output variables created for each column that is read by the operator. The corresponding `variable` fields will be set to the variable names assigned to the columns.
*/
variable?: string | null;
}
/**
* The request for Commit.
*/
export interface Schema$CommitRequest {
/**
* The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.
*/
mutations?: Schema$Mutation[];
/**
* If `true`, then statistics related to the transaction will be included in the CommitResponse. Default value is `false`.
*/
returnCommitStats?: boolean | null;
/**
* Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the `CommitRequest` is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.
*/
singleUseTransaction?: Schema$TransactionOptions;
/**
* Commit a previously-started transaction.
*/
transactionId?: string | null;
}
/**
* The response for Commit.
*/
export interface Schema$CommitResponse {
/**
* The statistics about this Commit. Not returned by default. For more information, see CommitRequest.return_commit_stats.
*/
commitStats?: Schema$CommitStats;
/**
* The Cloud Spanner timestamp at which the transaction committed.
*/
commitTimestamp?: string | null;
}
/**
* Additional statistics about a commit.
*/
export interface Schema$CommitStats {
/**
* The total number of mutations for the transaction. Knowing the `mutation_count` value can help you maximize the number of mutations in a transaction and minimize the number of API round trips. You can also monitor this value to prevent transactions from exceeding the system [limit](http://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data). If the number of mutations exceeds the limit, the server returns [INVALID_ARGUMENT](http://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
*/
mutationCount?: string | null;
}
/**
* Metadata type for the operation returned by CreateBackup.
*/
export interface Schema$CreateBackupMetadata {
/**
* The time at which cancellation of this operation was received. Operations.CancelOperation starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
*/
cancelTime?: string | null;
/**
* The name of the database the backup is created from.
*/
database?: string | null;
/**
* The name of the backup being created.
*/
name?: string | null;
/**
* The progress of the CreateBackup operation.
*/
progress?: Schema$OperationProgress;
}
/**
* Metadata type for the operation returned by CreateDatabase.
*/
export interface Schema$CreateDatabaseMetadata {
/**
* The database being created.
*/
database?: string | null;
}
/**
* The request for CreateDatabase.
*/
export interface Schema$CreateDatabaseRequest {
/**
* Required. A `CREATE DATABASE` statement, which specifies the ID of the new database. The database ID must conform to the regular expression `a-z*[a-z0-9]` and be between 2 and 30 characters in length. If the database ID is a reserved word or if it contains a hyphen, the database ID must be enclosed in backticks (`` ` ``).
*/
createStatement?: string | null;
/**
* Optional. The encryption configuration for the database. If this field is not specified, Cloud Spanner will encrypt/decrypt all data at rest using Google default encryption.
*/
encryptionConfig?: Schema$EncryptionConfig;
/**
* Optional. A list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created.
*/
extraStatements?: string[] | null;
}
/**
* Metadata type for the operation returned by CreateInstance.
*/
export interface Schema$CreateInstanceMetadata {
/**
* The time at which this operation was cancelled. If set, this operation is in the process of undoing itself (which is guaranteed to succeed) and cannot be cancelled again.
*/
cancelTime?: string | null;
/**
* The time at which this operation failed or was completed successfully.
*/
endTime?: string | null;
/**
* The instance being created.
*/
instance?: Schema$Instance;
/**
* The time at which the CreateInstance request was received.
*/
startTime?: string | null;
}
/**
* The request for CreateInstance.
*/
export interface Schema$CreateInstanceRequest {
/**
* Required. The instance to create. The name may be omitted, but if specified must be `/instances/`.
*/
instance?: Schema$Instance;
/**
* Required. The ID of the instance to create. Valid identifiers are of the form `a-z*[a-z0-9]` and must be between 2 and 64 characters in length.
*/
instanceId?: string | null;
}
/**
* The request for CreateSession.
*/
export interface Schema$CreateSessionRequest {
/**
* Required. The session to create.
*/
session?: Schema$Session;
}
/**
* A Cloud Spanner database.
*/
export interface Schema$Database {
/**
* Output only. If exists, the time at which the database creation started.
*/
createTime?: string | null;
/**
* Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
*/
earliestVersionTime?: string | null;
/**
* Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
*/
encryptionConfig?: Schema$EncryptionConfig;
/**
* Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as encryption state and the Cloud KMS key versions that are in use. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
*/
encryptionInfo?: Schema$EncryptionInfo[];
/**
* Required. The name of the database. Values are of the form `projects//instances//databases/`, where `` is as specified in the `CREATE DATABASE` statement. This name can be passed to other API methods to identify the database.
*/
name?: string | null;
/**
* Output only. Applicable only for restored databases. Contains information about the restore source.
*/
restoreInfo?: Schema$RestoreInfo;
/**
* Output only. The current database state.
*/
state?: string | null;
/**
* Output only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
*/
versionRetentionPeriod?: string | null;
}
/**
* Arguments to delete operations.
*/
export interface Schema$Delete {
/**
* Required. The primary keys of the rows within table to delete. The primary keys must be specified in the order in which they appear in the `PRIMARY KEY()` clause of the table's equivalent DDL statement (the DDL statement used to create the table). Delete is idempotent. The transaction will succeed even if some or all rows do not exist.
*/
keySet?: Schema$KeySet;
/**
* Required. The table whose rows will be deleted.
*/
table?: string | null;
}
/**
* A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \} The JSON representation for `Empty` is empty JSON object `{\}`.
*/
export interface Schema$Empty {
}
/**
* Encryption configuration for a Cloud Spanner database.
*/
export interface Schema$EncryptionConfig {
/**
* The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
*/
kmsKeyName?: string | null;
}
/**
* Encryption information for a Cloud Spanner database or backup.
*/
export interface Schema$EncryptionInfo {
/**
* Output only. If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
*/
encryptionStatus?: Schema$Status;
/**
* Output only. The type of encryption.
*/
encryptionType?: string | null;
/**
* Output only. A Cloud KMS key version that is being used to protect the database or backup.
*/
kmsKeyVersion?: string | null;
}
/**
* The request for ExecuteBatchDml.
*/
export interface Schema$ExecuteBatchDmlRequest {
/**
* Required. A per-transaction sequence number used to identify this request. This field makes each request idempotent such that if the request is received multiple times, at most one will succeed. The sequence number must be monotonically increasing within the transaction. If a request arrives for the first time with an out-of-order sequence number, the transaction may be aborted. Replays of previously handled requests will yield the same response as the first execution.
*/
seqno?: string | null;
/**
* Required. The list of statements to execute in this batch. Statements are executed serially, such that the effects of statement `i` are visible to statement `i+1`. Each statement must be a DML statement. Execution stops at the first failed statement; the remaining statements are not executed. Callers must provide at least one statement.
*/
statements?: Schema$Statement[];
/**
* Required. The transaction to use. Must be a read-write transaction. To protect against replays, single-use transactions are not supported. The caller must either supply an existing transaction ID or begin a new transaction.
*/
transaction?: Schema$TransactionSelector;
}
/**
* The response for ExecuteBatchDml. Contains a list of ResultSet messages, one for each DML statement that has successfully executed, in the same order as the statements in the request. If a statement fails, the status in the response body identifies the cause of the failure. To check for DML statements that failed, use the following approach: 1. Check the status in the response message. The google.rpc.Code enum value `OK` indicates that all statements were executed successfully. 2. If the status was not `OK`, check the number of result sets in the response. If the response contains `N` ResultSet messages, then statement `N+1` in the request failed. Example 1: * Request: 5 DML statements, all executed successfully. * Response: 5 ResultSet messages, with the status `OK`. Example 2: * Request: 5 DML statements. The third statement has a syntax error. * Response: 2 ResultSet messages, and a syntax error (`INVALID_ARGUMENT`) status. The number of ResultSet messages indicates that the third statement failed, and the fourth and fifth statements were not executed.
*/
export interface Schema$ExecuteBatchDmlResponse {
/**
* One ResultSet for each statement in the request that ran successfully, in the same order as the statements in the request. Each ResultSet does not contain any rows. The ResultSetStats in each ResultSet contain the number of rows modified by the statement. Only the first ResultSet in the response contains valid ResultSetMetadata.
*/
resultSets?: Schema$ResultSet[];
/**
* If all DML statements are executed successfully, the status is `OK`. Otherwise, the error status of the first failed statement.
*/
status?: Schema$Status;
}
/**
* The request for ExecuteSql and ExecuteStreamingSql.
*/
export interface Schema$ExecuteSqlRequest {
/**
* Parameter names and values that bind to placeholders in the SQL string. A parameter placeholder consists of the `@` character followed by the parameter name (for example, `@firstName`). Parameter names must conform to the naming requirements of identifiers as specified at https://cloud.google.com/spanner/docs/lexical#identifiers. Parameters can appear anywhere that a literal value is expected. The same parameter name can be used more than once, for example: `"WHERE id \> @msg_id AND id < @msg_id + 100"` It is an error to execute a SQL statement with unbound parameters.
*/
params?: {
[key: string]: any;
} | null;
/**
* It is not always possible for Cloud Spanner to infer the right SQL type from a JSON value. For example, values of type `BYTES` and values of type `STRING` both appear in params as JSON strings. In these cases, `param_types` can be used to specify the exact SQL type for some or all of the SQL statement parameters. See the definition of Type for more information about SQL types.
*/
paramTypes?: {
[key: string]: Schema$Type;
} | null;
/**
* If present, results will be restricted to the specified partition previously created using PartitionQuery(). There must be an exact match for the values of fields common to this message and the PartitionQueryRequest message used to create this partition_token.
*/
partitionToken?: string | null;
/**
* Used to control the amount of debugging information returned in ResultSetStats. If partition_token is set, query_mode can only be set to QueryMode.NORMAL.
*/
queryMode?: string | null;
/**
* Query optimizer configuration to use for the given query.
*/
queryOptions?: Schema$QueryOptions;
/**
* If this request is resuming a previously interrupted SQL statement execution, `resume_token` should be copied from the last PartialResultSet yielded before the interruption. Doing this enables the new SQL statement execution to resume where the last one left off. The rest of the request parameters must exactly match the request that yielded this token.
*/
resumeToken?: string | null;
/**
* A per-transaction sequence number used to identify this request. This field makes each request idempotent such that if the request is received multiple times, at most one will succeed. The sequence number must be monotonically increasing within the transaction. If a request arrives for the first time with an out-of-order sequence number, the transaction may be aborted. Replays of previously handled requests will yield the same response as the first execution. Required for DML statements. Ignored for queries.
*/
seqno?: string | null;
/**
* Required. The SQL string.
*/
sql?: string | null;
/**
* The transaction to use. For queries, if none is provided, the default is a temporary read-only transaction with strong concurrency. Standard DML statements require a read-write transaction. To protect against replays, single-use transactions are not supported. The caller must either supply an existing transaction ID or begin a new transaction. Partitioned DML requires an existing Partitioned DML transaction ID.
*/
transaction?: Schema$TransactionSelector;
}
/**
* Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
*/
export interface Schema$Expr {
/**
* Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
*/
description?: string | null;
/**
* Textual representation of an expression in Common Expression Language syntax.
*/
expression?: string | null;
/**
* Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
*/
location?: string | null;
/**
* Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
*/
title?: string | null;
}
/**
* Message representing a single field of a struct.
*/
export interface Schema$Field {
/**
* The name of the field. For reads, this is the column name. For SQL queries, it is the column alias (e.g., `"Word"` in the query `"SELECT 'hello' AS Word"`), or the column name (e.g., `"ColName"` in the query `"SELECT ColName FROM Table"`). Some columns might have an empty name (e.g., `"SELECT UPPER(ColName)"`). Note that a query result can contain multiple fields with the same name.
*/
name?: string | null;
/**
* The type of the field.
*/
type?: Schema$Type;
}
/**
* The response for GetDatabaseDdl.
*/
export interface Schema$GetDatabaseDdlResponse {
/**
* A list of formatted DDL statements defining the schema of the database specified in the request.
*/
statements?: string[] | null;
}
/**
* Request message for `GetIamPolicy` method.
*/
export interface Schema$GetIamPolicyRequest {
/**
* OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
*/
options?: Schema$GetPolicyOptions;
}
/**
* Encapsulates settings provided to GetIamPolicy.
*/
export interface Schema$GetPolicyOptions {
/**
* Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
*/
requestedPolicyVersion?: number | null;
}
/**
* An isolated set of Cloud Spanner resources on which databases can be hosted.
*/
export interface Schema$Instance {
/**
* Required. The name of the instance's configuration. Values are of the form `projects//instanceConfigs/`. See also InstanceConfig and ListInstanceConfigs.
*/
config?: string | null;
/**
* Required. The descriptive name for this instance as it appears in UIs. Must be unique per project and between 4 and 30 characters in length.
*/
displayName?: string | null;
/**
* Deprecated. This field is not populated.
*/
endpointUris?: string[] | null;
/**
* Cloud Labels are a flexible and lightweight mechanism for organizing cloud resources into groups that reflect a customer's organizational needs and deployment strategies. Cloud Labels can be used to filter collections of resources. They can be used to control how resource metrics are aggregated. And they can be used as arguments to policy management rules (e.g. route, firewall, load balancing, etc.). * 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 resource. See https://goo.gl/xmQnxf for more information on and examples of labels. If you plan to use labels in your own code, please note that additional characters may be allowed in the future. And so you are advised to use an internal label representation, such as JSON, which doesn't rely upon specific characters being disallowed. For example, representing labels as the string: name + "_" + value would prove problematic if we were to allow "_" in a future release.
*/
labels?: {
[key: string]: string;
} | null;
/**
* Required. A unique identifier for the instance, which cannot be changed after the instance is created. Values are of the form `projects//instances/a-z*[a-z0-9]`. The final segment of the name must be between 2 and 64 characters in length.
*/
name?: string | null;
/**
* The number of nodes allocated to this instance. This may be zero in API responses for instances that are not yet in state `READY`. See [the documentation](https://cloud.google.com/spanner/docs/instances#node_count) for more information about nodes.
*/
nodeCount?: number | null;
/**
* Output only. The current instance state. For CreateInstance, the state must be either omitted or set to `CREATING`. For UpdateInstance, the state must be either omitted or set to `READY`.
*/
state?: string | null;
}
/**
* A possible configuration for a Cloud Spanner instance. Configurations define the geographic placement of nodes and their replication.
*/
export interface Schema$InstanceConfig {
/**
* The name of this instance configuration as it appears in UIs.
*/
displayName?: string | null;
/**
* A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`
*/
name?: string | null;
/**
* The geographic placement of nodes in this instance configuration and their replication properties.
*/
replicas?: Schema$ReplicaInfo[];
}
/**
* KeyRange represents a range of rows in a table or index. A range has a start key and an end key. These keys can be open or closed, indicating if the range includes rows with that key. Keys are represented by lists, where the ith value in the list corresponds to the ith component of the table or index primary key. Individual values are encoded as described here. For example, consider the following table definition: CREATE TABLE UserEvents ( UserName STRING(MAX), EventDate STRING(10) ) PRIMARY KEY(UserName, EventDate); The following keys name rows in this table: "Bob", "2014-09-23" Since the `UserEvents` table's `PRIMARY KEY` clause names two columns, each `UserEvents` key has two elements; the first is the `UserName`, and the second is the `EventDate`. Key ranges with multiple components are interpreted lexicographically by component using the table or index key's declared sort order. For example, the following range returns all events for user `"Bob"` that occurred in the year 2015: "start_closed": ["Bob", "2015-01-01"] "end_closed": ["Bob", "2015-12-31"] Start and end keys can omit trailing key components. This affects the inclusion and exclusion of rows that exactly match the provided key components: if the key is closed, then rows that exactly match the provided components are included; if the key is open, then rows that exactly match are not included. For example, the following range includes all events for `"Bob"` that occurred during and after the year 2000: "start_closed": ["Bob", "2000-01-01"] "end_closed": ["Bob"] The next example retrieves all events for `"Bob"`: "start_closed": ["Bob"] "end_closed": ["Bob"] To retrieve events before the year 2000: "start_closed": ["Bob"] "end_open": ["Bob", "2000-01-01"] The following range includes all rows in the table: "start_closed": [] "end_closed": [] This range returns all users whose `UserName` begins with any character from A to C: "start_closed": ["A"] "end_open": ["D"] This range returns all users whose `UserName` begins with B: "start_closed": ["B"] "end_open": ["C"] Key ranges honor column sort order. For example, suppose a table is defined as follows: CREATE TABLE DescendingSortedTable { Key INT64, ... ) PRIMARY KEY(Key DESC); The following range retrieves all rows with key values between 1 and 100 inclusive: "start_closed": ["100"] "end_closed": ["1"] Note that 100 is passed as the start, and 1 is passed as the end, because `Key` is a descending column in the schema.
*/
export interface Schema$KeyRange {
/**
* If the end is closed, then the range includes all rows whose first `len(end_closed)` key columns exactly match `end_closed`.
*/
endClosed?: any[] | null;
/**
* If the end is open, then the range excludes rows whose first `len(end_open)` key columns exactly match `end_open`.
*/
endOpen?: any[] | null;
/**
* If the start is closed, then the range includes all rows whose first `len(start_closed)` key columns exactly match `start_closed`.
*/
startClosed?: any[] | null;
/**
* If the start is open, then the range excludes rows whose first `len(start_open)` key columns exactly match `start_open`.
*/
startOpen?: any[] | null;
}
/**
* `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All the keys are expected to be in the same table or index. The keys need not be sorted in any particular way. If the same key is specified multiple times in the set (for example if two ranges, two keys, or a key and a range overlap), Cloud Spanner behaves as if the key were only specified once.
*/
export interface Schema$KeySet {
/**
* For convenience `all` can be set to `true` to indicate that this `KeySet` matches all keys in the table or index. Note that any keys specified in `keys` or `ranges` are only yielded once.
*/
all?: boolean | null;
/**
* A list of specific keys. Entries in `keys` should have exactly as many elements as there are columns in the primary or index key with which this `KeySet` is used. Individual key values are encoded as described here.
*/
keys?: any[][] | null;
/**
* A list of key ranges. See KeyRange for more information about key range specifications.
*/
ranges?: Schema$KeyRange[];
}
/**
* The response for ListBackupOperations.
*/
export interface Schema$ListBackupOperationsResponse {
/**
* `next_page_token` can be sent in a subsequent ListBackupOperations call to fetch more of the matching metadata.
*/
nextPageToken?: string | null;
/**
* The list of matching backup long-running operations. Each operation's name will be prefixed by the backup's name and the operation's metadata will be of type CreateBackupMetadata. Operations returned include those that are pending or have completed/failed/canceled within the last 7 days. Operations returned are ordered by `operation.metadata.value.progress.start_time` in descending order starting from the most recently started operation.
*/
operations?: Schema$Operation[];
}
/**
* The response for ListBackups.
*/
export interface Schema$ListBackupsResponse {
/**
* The list of matching backups. Backups returned are ordered by `create_time` in descending order, starting from the most recent `create_time`.
*/
backups?: Schema$Backup[];
/**
* `next_page_token` can be sent in a subsequent ListBackups call to fetch more of the matching backups.
*/
nextPageToken?: string | null;
}
/**
* The response for ListDatabaseOperations.
*/
export interface Schema$ListDatabaseOperationsResponse {
/**
* `next_page_token` can be sent in a subsequent ListDatabaseOperations call to fetch more of the matching metadata.
*/
nextPageToken?: string | null;
/**
* The list of matching database long-running operations. Each operation's name will be prefixed by the database's name. The operation's metadata field type `metadata.type_url` describes the type of the metadata.
*/
operations?: Schema$Operation[];
}
/**
* The response for ListDatabases.
*/
export interface Schema$ListDatabasesResponse {
/**
* Databases that matched the request.
*/
databases?: Schema$Database[];
/**
* `next_page_token` can be sent in a subsequent ListDatabases call to fetch more of the matching databases.
*/
nextPageToken?: string | null;
}
/**
* The response for ListInstanceConfigs.
*/
export interface Schema$ListInstanceConfigsResponse {
/**
* The list of requested instance configurations.
*/
instanceConfigs?: Schema$InstanceConfig[];
/**
* `next_page_token` can be sent in a subsequent ListInstanceConfigs call to fetch more of the matching instance configurations.
*/
nextPageToken?: string | null;
}
/**
* The response for ListInstances.
*/
export interface Schema$ListInstancesResponse {
/**
* The list of requested instances.
*/
instances?: Schema$Instance[];
/**
* `next_page_token` can be sent in a subsequent ListInstances call to fetch more of the matching instances.
*/
nextPageToken?: string | null;
/**
* The list of unreachable instances. It includes the names of instances whose metadata could not be retrieved within instance_deadline.
*/
unreachable?: string[] | null;
}
/**
* The response message for Operations.ListOperations.
*/
export interface Schema$ListOperationsResponse {
/**
* The standard List next-page token.
*/
nextPageToken?: string | null;
/**
* A list of operations that matches the specified filter in the request.
*/
operations?: Schema$Operation[];
}
/**
* The response for ListSessions.
*/
export interface Schema$ListSessionsResponse {
/**
* `next_page_token` can be sent in a subsequent ListSessions call to fetch more of the matching sessions.
*/
nextPageToken?: string | null;
/**
* The list of requested sessions.
*/
sessions?: Schema$Session[];
}
/**
* A modification to one or more Cloud Spanner rows. Mutations can be applied to a Cloud Spanner database by sending them in a Commit call.
*/
export interface Schema$Mutation {
/**
* Delete rows from a table. Succeeds whether or not the named rows were present.
*/
delete?: Schema$Delete;
/**
* Insert new rows in a table. If any of the rows already exist, the write or transaction fails with error `ALREADY_EXISTS`.
*/
insert?: Schema$Write;
/**
* Like insert, except that if the row already exists, then its column values are overwritten with the ones provided. Any column values not explicitly written are preserved. When using insert_or_update, just as when using insert, all `NOT NULL` columns in the table must be given a value. This holds true even when the row already exists and will therefore actually be updated.
*/
insertOrUpdate?: Schema$Write;
/**
* Like insert, except that if the row already exists, it is deleted, and the column values provided are inserted instead. Unlike insert_or_update, this means any values not explicitly written become `NULL`. In an interleaved table, if you create the child table with the `ON DELETE CASCADE` annotation, then replacing a parent row also deletes the child rows. Otherwise, you must delete the child rows before you replace the parent row.
*/
replace?: Schema$Write;
/**
* Update existing rows in a table. If any of the rows does not already exist, the transaction fails with error `NOT_FOUND`.
*/
update?: Schema$Write;
}
/**
* This resource represents a long-running operation that is the result of a network API call.
*/
export interface Schema$Operation {
/**
* If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
*/
done?: boolean | null;
/**
* The error result of the operation in case of failure or cancellation.
*/
error?: Schema$Status;
/**
* Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
*/
metadata?: {
[key: string]: any;
} | null;
/**
* The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id\}`.
*/
name?: string | null;
/**
* The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
*/
response?: {
[key: string]: any;
} | null;
}
/**
* Encapsulates progress related information for a Cloud Spanner long running operation.
*/
export interface Schema$OperationProgress {
/**
* If set, the time at which this operation failed or was completed successfully.
*/
endTime?: string | null;
/**
* Percent completion of the operation. Values are between 0 and 100 inclusive.
*/
progressPercent?: number | null;
/**
* Time the request was received.
*/
startTime?: string | null;
}
/**
* Metadata type for the long-running operation used to track the progress of optimizations performed on a newly restored database. This long-running operation is automatically created by the system after the successful completion of a database restore, and cannot be cancelled.
*/
export interface Schema$OptimizeRestoredDatabaseMetadata {
/**
* Name of the restored database being optimized.
*/
name?: string | null;
/**
* The progress of the post-restore optimizations.
*/
progress?: Schema$OperationProgress;
}
/**
* Partial results from a streaming read or SQL query. Streaming reads and SQL queries better tolerate large result sets, large rows, and large values, but are a little trickier to consume.
*/
export interface Schema$PartialResultSet {
/**
* If true, then the final value in values is chunked, and must be combined with more values from subsequent `PartialResultSet`s to obtain a complete field value.
*/
chunkedValue?: boolean | null;
/**
* Metadata about the result set, such as row type information. Only present in the first response.
*/
metadata?: Schema$ResultSetMetadata;
/**
* Streaming calls might be interrupted for a variety of reasons, such as TCP connection loss. If this occurs, the stream of results can be resumed by re-sending the original request and including `resume_token`. Note that executing any other transaction in the same session inv