Skip to content

Commit

Permalink
feat(spanner): update the API
Browse files Browse the repository at this point in the history
#### spanner:v1

The following keys were added:
- schemas.BeginTransactionRequest.properties.requestOptions.$ref
- schemas.BeginTransactionRequest.properties.requestOptions.description
- schemas.CommitRequest.properties.requestOptions.$ref
- schemas.CommitRequest.properties.requestOptions.description
- schemas.ExecuteBatchDmlRequest.properties.requestOptions.$ref
- schemas.ExecuteBatchDmlRequest.properties.requestOptions.description
- schemas.ExecuteSqlRequest.properties.requestOptions.$ref
- schemas.ExecuteSqlRequest.properties.requestOptions.description
- schemas.ReadRequest.properties.requestOptions.$ref
- schemas.ReadRequest.properties.requestOptions.description
- schemas.RequestOptions.description
- schemas.RequestOptions.id
- schemas.RequestOptions.properties.priority.description
- schemas.RequestOptions.properties.priority.enum
- schemas.RequestOptions.properties.priority.enumDescriptions
- schemas.RequestOptions.properties.priority.type
- schemas.RequestOptions.properties.requestTag.description
- schemas.RequestOptions.properties.requestTag.type
- schemas.RequestOptions.properties.transactionTag.description
- schemas.RequestOptions.properties.transactionTag.type
- schemas.RequestOptions.type
- schemas.UpdateDatabaseDdlMetadata.properties.progress.description
- schemas.UpdateDatabaseDdlMetadata.properties.progress.items.$ref
- schemas.UpdateDatabaseDdlMetadata.properties.progress.type

The following keys were changed:
- auth.oauth2.scopes.https://www.googleapis.com/auth/cloud-platform.description
- schemas.QueryOptions.properties.optimizerStatisticsPackage.description
- schemas.RestoreDatabaseRequest.properties.encryptionConfig.description
  • Loading branch information
yoshi-automation authored and sofisl committed Apr 5, 2021
1 parent d9b89cf commit 9bb3633
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 7 deletions.
66 changes: 62 additions & 4 deletions discovery/spanner-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
"description": "See, edit, configure, and delete your Google Cloud Platform data"
},
"https://www.googleapis.com/auth/spanner.admin": {
"description": "Administer your Spanner databases"
Expand Down Expand Up @@ -1923,7 +1923,7 @@
}
}
},
"revision": "20210309",
"revision": "20210325",
"rootUrl": "https://spanner.googleapis.com/",
"schemas": {
"Backup": {
Expand Down Expand Up @@ -2053,6 +2053,10 @@
"options": {
"$ref": "TransactionOptions",
"description": "Required. Options for the new transaction."
},
"requestOptions": {
"$ref": "RequestOptions",
"description": "Common options for this request. Priority is ignored for this request. Setting the priority in this request_options struct will not do anything. To set the priority for a transaction, set it on the reads and writes that are part of this transaction instead."
}
},
"type": "object"
Expand Down Expand Up @@ -2110,6 +2114,10 @@
},
"type": "array"
},
"requestOptions": {
"$ref": "RequestOptions",
"description": "Common options for this request."
},
"returnCommitStats": {
"description": "If `true`, then statistics related to the transaction will be included in the CommitResponse. Default value is `false`.",
"type": "boolean"
Expand Down Expand Up @@ -2394,6 +2402,10 @@
"description": "The request for ExecuteBatchDml.",
"id": "ExecuteBatchDmlRequest",
"properties": {
"requestOptions": {
"$ref": "RequestOptions",
"description": "Common options for this request."
},
"seqno": {
"description": "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.",
"format": "int64",
Expand Down Expand Up @@ -2473,6 +2485,10 @@
"$ref": "QueryOptions",
"description": "Query optimizer configuration to use for the given query."
},
"requestOptions": {
"$ref": "RequestOptions",
"description": "Common options for this request."
},
"resumeToken": {
"description": "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.",
"format": "byte",
Expand Down Expand Up @@ -3195,7 +3211,7 @@
"id": "QueryOptions",
"properties": {
"optimizerStatisticsPackage": {
"description": "Query optimizer statistics package to use. This parameter allows individual queries to use a different query optimizer statistics. Specifying `latest` as a value instructs Cloud Spanner to use the latest generated statistics package. If not specified, Cloud Spanner uses statistics package set at the database level options, or latest if the database option is not set. The statistics package requested by the query has to be exempt from garbage collection. This can be achieved with the following DDL statement: ``` ALTER STATISTICS SET OPTIONS (allow_gc=false) ``` The list of available statistics packages can be queried from `SPANNER_SYS.OPTIMIZER_STATISTICS_PACKAGES`. Executing a SQL statement with an invalid optimizer statistics package or with statistics package that allows garbage collection fails with an `INVALID_ARGUMENT` error.",
"description": "An option to control the selection of optimizer statistics package. This parameter allows individual queries to use a different query optimizer statistics package. Specifying `latest` as a value instructs Cloud Spanner to use the latest generated statistics package. If not specified, Cloud Spanner uses the statistics package set at the database level options, or the latest package if the database option is not set. The statistics package requested by the query has to be exempt from garbage collection. This can be achieved with the following DDL statement: ``` ALTER STATISTICS SET OPTIONS (allow_gc=false) ``` The list of available statistics packages can be queried from `INFORMATION_SCHEMA.SPANNER_STATISTICS`. Executing a SQL statement with an invalid optimizer statistics package or with a statistics package that allows garbage collection fails with an `INVALID_ARGUMENT` error.",
"type": "string"
},
"optimizerVersion": {
Expand Down Expand Up @@ -3283,6 +3299,10 @@
"format": "byte",
"type": "string"
},
"requestOptions": {
"$ref": "RequestOptions",
"description": "Common options for this request."
},
"resumeToken": {
"description": "If this request is resuming a previously interrupted read, `resume_token` should be copied from the last PartialResultSet yielded before the interruption. Doing this enables the new read to resume where the last read left off. The rest of the request parameters must exactly match the request that yielded this token.",
"format": "byte",
Expand Down Expand Up @@ -3335,6 +3355,37 @@
},
"type": "object"
},
"RequestOptions": {
"description": "Common request options for various APIs.",
"id": "RequestOptions",
"properties": {
"priority": {
"description": "Priority for the request.",
"enum": [
"PRIORITY_UNSPECIFIED",
"PRIORITY_LOW",
"PRIORITY_MEDIUM",
"PRIORITY_HIGH"
],
"enumDescriptions": [
"`PRIORITY_UNSPECIFIED` is equivalent to `PRIORITY_HIGH`.",
"This specifies that the request is low priority.",
"This specifies that the request is medium priority.",
"This specifies that the request is high priority."
],
"type": "string"
},
"requestTag": {
"description": "A per-request tag which can be applied to queries or reads, used for statistics collection. Both request_tag and transaction_tag can be specified for a read or query that belongs to a transaction. This field is ignored for requests where it's not applicable (e.g. CommitRequest). `request_tag` must be a valid identifier of the form: `a-zA-Z` between 2 and 64 characters in length",
"type": "string"
},
"transactionTag": {
"description": "A tag used for statistics collection about this transaction. Both request_tag and transaction_tag can be specified for a read or query that belongs to a transaction. The value of transaction_tag should be the same for all requests belonging to the same transaction. If this request doesn’t belong to any transaction, transaction_tag will be ignored. `transaction_tag` must be a valid identifier of the format: `a-zA-Z{0,49}`",
"type": "string"
}
},
"type": "object"
},
"RestoreDatabaseEncryptionConfig": {
"description": "Encryption configuration for the restored database.",
"id": "RestoreDatabaseEncryptionConfig",
Expand Down Expand Up @@ -3416,7 +3467,7 @@
},
"encryptionConfig": {
"$ref": "RestoreDatabaseEncryptionConfig",
"description": "Optional. An encryption configuration describing the encryption type and key resources in Cloud KMS used to encrypt/decrypt the database to restore to. If this field is not specified, the restored database will use the same encryption configuration as the backup by default, namely encryption_type = `USE_CONFIG_DEFAULT_OR_DATABASE_ENCRYPTION`."
"description": "Optional. An encryption configuration describing the encryption type and key resources in Cloud KMS used to encrypt/decrypt the database to restore to. If this field is not specified, the restored database will use the same encryption configuration as the backup by default, namely encryption_type = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`."
}
},
"type": "object"
Expand Down Expand Up @@ -3798,6 +3849,13 @@
"description": "The database being modified.",
"type": "string"
},
"progress": {
"description": "The progress of the UpdateDatabaseDdl operations. Currently, only index creation statements will have a continuously updating progress. For non-index creation statements, `progress[i]` will have start time and end time populated with commit timestamp of operation, as well as a progress of 100% once the operation has completed. `progress[i]` is the operation progress for `statements[i]`.",
"items": {
"$ref": "OperationProgress"
},
"type": "array"
},
"statements": {
"description": "For an update this list contains all the statements. For an individual statement, this list contains only that statement.",
"items": {
Expand Down
54 changes: 51 additions & 3 deletions src/apis/spanner/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ export namespace spanner_v1 {
* Required. Options for the new transaction.
*/
options?: Schema$TransactionOptions;
/**
* Common options for this request. Priority is ignored for this request. Setting the priority in this request_options struct will not do anything. To set the priority for a transaction, set it on the reads and writes that are part of this transaction instead.
*/
requestOptions?: Schema$RequestOptions;
}
/**
* Associates `members` with a `role`.
Expand Down Expand Up @@ -260,6 +264,10 @@ export namespace spanner_v1 {
* 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[];
/**
* Common options for this request.
*/
requestOptions?: Schema$RequestOptions;
/**
* If `true`, then statistics related to the transaction will be included in the CommitResponse. Default value is `false`.
*/
Expand Down Expand Up @@ -469,6 +477,10 @@ export namespace spanner_v1 {
* The request for ExecuteBatchDml.
*/
export interface Schema$ExecuteBatchDmlRequest {
/**
* Common options for this request.
*/
requestOptions?: Schema$RequestOptions;
/**
* 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.
*/
Expand Down Expand Up @@ -519,6 +531,10 @@ export namespace spanner_v1 {
* Query optimizer configuration to use for the given query.
*/
queryOptions?: Schema$QueryOptions;
/**
* Common options for this request.
*/
requestOptions?: Schema$RequestOptions;
/**
* 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.
*/
Expand Down Expand Up @@ -1046,7 +1062,7 @@ export namespace spanner_v1 {
*/
export interface Schema$QueryOptions {
/**
* Query optimizer statistics package to use. This parameter allows individual queries to use a different query optimizer statistics. Specifying `latest` as a value instructs Cloud Spanner to use the latest generated statistics package. If not specified, Cloud Spanner uses statistics package set at the database level options, or latest if the database option is not set. The statistics package requested by the query has to be exempt from garbage collection. This can be achieved with the following DDL statement: ``` ALTER STATISTICS SET OPTIONS (allow_gc=false) ``` The list of available statistics packages can be queried from `SPANNER_SYS.OPTIMIZER_STATISTICS_PACKAGES`. Executing a SQL statement with an invalid optimizer statistics package or with statistics package that allows garbage collection fails with an `INVALID_ARGUMENT` error.
* An option to control the selection of optimizer statistics package. This parameter allows individual queries to use a different query optimizer statistics package. Specifying `latest` as a value instructs Cloud Spanner to use the latest generated statistics package. If not specified, Cloud Spanner uses the statistics package set at the database level options, or the latest package if the database option is not set. The statistics package requested by the query has to be exempt from garbage collection. This can be achieved with the following DDL statement: ``` ALTER STATISTICS SET OPTIONS (allow_gc=false) ``` The list of available statistics packages can be queried from `INFORMATION_SCHEMA.SPANNER_STATISTICS`. Executing a SQL statement with an invalid optimizer statistics package or with a statistics package that allows garbage collection fails with an `INVALID_ARGUMENT` error.
*/
optimizerStatisticsPackage?: string | null;
/**
Expand Down Expand Up @@ -1116,6 +1132,10 @@ export namespace spanner_v1 {
* If present, results will be restricted to the specified partition previously created using PartitionRead(). There must be an exact match for the values of fields common to this message and the PartitionReadRequest message used to create this partition_token.
*/
partitionToken?: string | null;
/**
* Common options for this request.
*/
requestOptions?: Schema$RequestOptions;
/**
* If this request is resuming a previously interrupted read, `resume_token` should be copied from the last PartialResultSet yielded before the interruption. Doing this enables the new read to resume where the last read left off. The rest of the request parameters must exactly match the request that yielded this token.
*/
Expand Down Expand Up @@ -1147,6 +1167,23 @@ export namespace spanner_v1 {
*/
type?: string | null;
}
/**
* Common request options for various APIs.
*/
export interface Schema$RequestOptions {
/**
* Priority for the request.
*/
priority?: string | null;
/**
* A per-request tag which can be applied to queries or reads, used for statistics collection. Both request_tag and transaction_tag can be specified for a read or query that belongs to a transaction. This field is ignored for requests where it's not applicable (e.g. CommitRequest). `request_tag` must be a valid identifier of the form: `a-zA-Z` between 2 and 64 characters in length
*/
requestTag?: string | null;
/**
* A tag used for statistics collection about this transaction. Both request_tag and transaction_tag can be specified for a read or query that belongs to a transaction. The value of transaction_tag should be the same for all requests belonging to the same transaction. If this request doesn’t belong to any transaction, transaction_tag will be ignored. `transaction_tag` must be a valid identifier of the format: `a-zA-Z{0,49\}`
*/
transactionTag?: string | null;
}
/**
* Encryption configuration for the restored database.
*/
Expand Down Expand Up @@ -1202,7 +1239,7 @@ export namespace spanner_v1 {
*/
databaseId?: string | null;
/**
* Optional. An encryption configuration describing the encryption type and key resources in Cloud KMS used to encrypt/decrypt the database to restore to. If this field is not specified, the restored database will use the same encryption configuration as the backup by default, namely encryption_type = `USE_CONFIG_DEFAULT_OR_DATABASE_ENCRYPTION`.
* Optional. An encryption configuration describing the encryption type and key resources in Cloud KMS used to encrypt/decrypt the database to restore to. If this field is not specified, the restored database will use the same encryption configuration as the backup by default, namely encryption_type = `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
*/
encryptionConfig?: Schema$RestoreDatabaseEncryptionConfig;
}
Expand Down Expand Up @@ -1459,6 +1496,10 @@ export namespace spanner_v1 {
* The database being modified.
*/
database?: string | null;
/**
* The progress of the UpdateDatabaseDdl operations. Currently, only index creation statements will have a continuously updating progress. For non-index creation statements, `progress[i]` will have start time and end time populated with commit timestamp of operation, as well as a progress of 100% once the operation has completed. `progress[i]` is the operation progress for `statements[i]`.
*/
progress?: Schema$OperationProgress[];
/**
* For an update this list contains all the statements. For an individual statement, this list contains only that statement.
*/
Expand Down Expand Up @@ -7613,7 +7654,8 @@ export namespace spanner_v1 {
* requestBody: {
* // request body parameters
* // {
* // "options": {}
* // "options": {},
* // "requestOptions": {}
* // }
* },
* }
Expand Down Expand Up @@ -7757,6 +7799,7 @@ export namespace spanner_v1 {
* // request body parameters
* // {
* // "mutations": [],
* // "requestOptions": {},
* // "returnCommitStats": false,
* // "singleUseTransaction": {},
* // "transactionId": "my_transactionId"
Expand Down Expand Up @@ -8173,6 +8216,7 @@ export namespace spanner_v1 {
* requestBody: {
* // request body parameters
* // {
* // "requestOptions": {},
* // "seqno": "my_seqno",
* // "statements": [],
* // "transaction": {}
Expand Down Expand Up @@ -8330,6 +8374,7 @@ export namespace spanner_v1 {
* // "partitionToken": "my_partitionToken",
* // "queryMode": "my_queryMode",
* // "queryOptions": {},
* // "requestOptions": {},
* // "resumeToken": "my_resumeToken",
* // "seqno": "my_seqno",
* // "sql": "my_sql",
Expand Down Expand Up @@ -8482,6 +8527,7 @@ export namespace spanner_v1 {
* // "partitionToken": "my_partitionToken",
* // "queryMode": "my_queryMode",
* // "queryOptions": {},
* // "requestOptions": {},
* // "resumeToken": "my_resumeToken",
* // "seqno": "my_seqno",
* // "sql": "my_sql",
Expand Down Expand Up @@ -9222,6 +9268,7 @@ export namespace spanner_v1 {
* // "keySet": {},
* // "limit": "my_limit",
* // "partitionToken": "my_partitionToken",
* // "requestOptions": {},
* // "resumeToken": "my_resumeToken",
* // "table": "my_table",
* // "transaction": {}
Expand Down Expand Up @@ -9512,6 +9559,7 @@ export namespace spanner_v1 {
* // "keySet": {},
* // "limit": "my_limit",
* // "partitionToken": "my_partitionToken",
* // "requestOptions": {},
* // "resumeToken": "my_resumeToken",
* // "table": "my_table",
* // "transaction": {}
Expand Down

0 comments on commit 9bb3633

Please sign in to comment.