Skip to content

Commit e8db575

Browse files
yoshi-automationsofisl
authored andcommitted
feat(spanner): update the API
#### spanner:v1 The following keys were added: - schemas.ReadRequest.properties.lockHint.description - schemas.ReadRequest.properties.lockHint.enum - schemas.ReadRequest.properties.lockHint.enumDescriptions - schemas.ReadRequest.properties.lockHint.type - schemas.ReadRequest.properties.orderBy.description - schemas.ReadRequest.properties.orderBy.enum - schemas.ReadRequest.properties.orderBy.enumDescriptions - schemas.ReadRequest.properties.orderBy.type The following keys were changed: - resources.projects.resources.instanceConfigs.methods.list.description - resources.projects.resources.instanceConfigs.methods.patch.parameters.name.description - schemas.InstanceConfig.properties.name.description - schemas.InstanceConfig.properties.replicas.description - schemas.Session.properties.multiplexed.description
1 parent 839c56f commit e8db575

File tree

2 files changed

+47
-11
lines changed

2 files changed

+47
-11
lines changed

discovery/spanner-v1.json

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
]
261261
},
262262
"list": {
263-
"description": "Lists the supported instance configurations for a given project.",
263+
"description": "Lists the supported instance configurations for a given project. Returns both Google managed configs and user managed configs.",
264264
"flatPath": "v1/projects/{projectsId}/instanceConfigs",
265265
"httpMethod": "GET",
266266
"id": "spanner.projects.instanceConfigs.list",
@@ -306,7 +306,7 @@
306306
],
307307
"parameters": {
308308
"name": {
309-
"description": "A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`.",
309+
"description": "A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`. User instance config must start with `custom-`.",
310310
"location": "path",
311311
"pattern": "^projects/[^/]+/instanceConfigs/[^/]+$",
312312
"required": true,
@@ -3005,7 +3005,7 @@
30053005
}
30063006
}
30073007
},
3008-
"revision": "20240529",
3008+
"revision": "20240612",
30093009
"rootUrl": "https://spanner.googleapis.com/",
30103010
"schemas": {
30113011
"AutoscalingConfig": {
@@ -4521,7 +4521,7 @@
45214521
"type": "array"
45224522
},
45234523
"name": {
4524-
"description": "A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`.",
4524+
"description": "A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`. User instance config must start with `custom-`.",
45254525
"type": "string"
45264526
},
45274527
"optionalReplicas": {
@@ -4555,7 +4555,7 @@
45554555
"type": "boolean"
45564556
},
45574557
"replicas": {
4558-
"description": "The geographic placement of nodes in this instance configuration and their replication properties.",
4558+
"description": "The geographic placement of nodes in this instance configuration and their replication properties. To create user managed configurations, input `replicas` must include all replicas in `replicas` of the `base_config` and include one or more replicas in the `optional_replicas` of the `base_config`.",
45594559
"items": {
45604560
"$ref": "ReplicaInfo"
45614561
},
@@ -5748,6 +5748,34 @@
57485748
"format": "int64",
57495749
"type": "string"
57505750
},
5751+
"lockHint": {
5752+
"description": "Optional. Lock Hint for the request, it can only be used with read-write transactions.",
5753+
"enum": [
5754+
"LOCK_HINT_UNSPECIFIED",
5755+
"LOCK_HINT_SHARED",
5756+
"LOCK_HINT_EXCLUSIVE"
5757+
],
5758+
"enumDescriptions": [
5759+
"Default value. LOCK_HINT_UNSPECIFIED is equivalent to LOCK_HINT_SHARED.",
5760+
"Acquire shared locks. By default when you perform a read as part of a read-write transaction, Spanner acquires shared read locks, which allows other reads to still access the data until your transaction is ready to commit. When your transaction is committing and writes are being applied, the transaction attempts to upgrade to an exclusive lock for any data you are writing. For more information about locks, see [Lock modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes).",
5761+
"Acquire exclusive locks. Requesting exclusive locks is beneficial if you observe high write contention, which means you notice that multiple transactions are concurrently trying to read and write to the same data, resulting in a large number of aborts. This problem occurs when two transactions initially acquire shared locks and then both try to upgrade to exclusive locks at the same time. In this situation both transactions are waiting for the other to give up their lock, resulting in a deadlocked situation. Spanner is able to detect this occurring and force one of the transactions to abort. However, this is a slow and expensive operation and results in lower performance. In this case it makes sense to acquire exclusive locks at the start of the transaction because then when multiple transactions try to act on the same data, they automatically get serialized. Each transaction waits its turn to acquire the lock and avoids getting into deadlock situations. Because the exclusive lock hint is just a hint, it should not be considered equivalent to a mutex. In other words, you should not use Spanner exclusive locks as a mutual exclusion mechanism for the execution of code outside of Spanner. **Note:** Request exclusive locks judiciously because they block others from reading that data for the entire transaction, rather than just when the writes are being performed. Unless you observe high write contention, you should use the default of shared read locks so you don't prematurely block other clients from reading the data that you're writing to."
5762+
],
5763+
"type": "string"
5764+
},
5765+
"orderBy": {
5766+
"description": "Optional. Order for the returned rows. By default, Spanner will return result rows in primary key order except for PartitionRead requests. For applications that do not require rows to be returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, resulting in lower latencies in certain cases (e.g. bulk point lookups).",
5767+
"enum": [
5768+
"ORDER_BY_UNSPECIFIED",
5769+
"ORDER_BY_PRIMARY_KEY",
5770+
"ORDER_BY_NO_ORDER"
5771+
],
5772+
"enumDescriptions": [
5773+
"Default value. ORDER_BY_UNSPECIFIED is equivalent to ORDER_BY_PRIMARY_KEY.",
5774+
"Read rows are returned in primary key order. In the event that this option is used in conjunction with the `partition_token` field, the API will return an `INVALID_ARGUMENT` error.",
5775+
"Read rows are returned in any order."
5776+
],
5777+
"type": "string"
5778+
},
57515779
"partitionToken": {
57525780
"description": "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.",
57535781
"format": "byte",
@@ -6164,7 +6192,7 @@
61646192
"type": "object"
61656193
},
61666194
"multiplexed": {
6167-
"description": "Optional. If true, specifies a multiplexed session. A multiplexed session may be used for multiple, concurrent read-only operations but can not be used for read-write transactions, partitioned reads, or partitioned queries. Multiplexed sessions can be created via CreateSession but not via BatchCreateSessions. Multiplexed sessions may not be deleted nor listed.",
6195+
"description": "Optional. If true, specifies a multiplexed session. Use a multiplexed session for multiple, concurrent read-only operations. Don't use them for read-write transactions, partitioned reads, or partitioned queries. Use CreateSession to create multiplexed sessions. Don't use BatchCreateSessions to create a multiplexed session. You can't delete or list multiplexed sessions.",
61686196
"type": "boolean"
61696197
},
61706198
"name": {

src/apis/spanner/v1.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ export namespace spanner_v1 {
11861186
*/
11871187
leaderOptions?: string[] | null;
11881188
/**
1189-
* A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`.
1189+
* A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`. User instance config must start with `custom-`.
11901190
*/
11911191
name?: string | null;
11921192
/**
@@ -1202,7 +1202,7 @@ export namespace spanner_v1 {
12021202
*/
12031203
reconciling?: boolean | null;
12041204
/**
1205-
* The geographic placement of nodes in this instance configuration and their replication properties.
1205+
* The geographic placement of nodes in this instance configuration and their replication properties. To create user managed configurations, input `replicas` must include all replicas in `replicas` of the `base_config` and include one or more replicas in the `optional_replicas` of the `base_config`.
12061206
*/
12071207
replicas?: Schema$ReplicaInfo[];
12081208
/**
@@ -2058,6 +2058,14 @@ export namespace spanner_v1 {
20582058
* If greater than zero, only the first `limit` rows are yielded. If `limit` is zero, the default is no limit. A limit cannot be specified if `partition_token` is set.
20592059
*/
20602060
limit?: string | null;
2061+
/**
2062+
* Optional. Lock Hint for the request, it can only be used with read-write transactions.
2063+
*/
2064+
lockHint?: string | null;
2065+
/**
2066+
* Optional. Order for the returned rows. By default, Spanner will return result rows in primary key order except for PartitionRead requests. For applications that do not require rows to be returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval, resulting in lower latencies in certain cases (e.g. bulk point lookups).
2067+
*/
2068+
orderBy?: string | null;
20612069
/**
20622070
* 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.
20632071
*/
@@ -2335,7 +2343,7 @@ export namespace spanner_v1 {
23352343
*/
23362344
labels?: {[key: string]: string} | null;
23372345
/**
2338-
* Optional. If true, specifies a multiplexed session. A multiplexed session may be used for multiple, concurrent read-only operations but can not be used for read-write transactions, partitioned reads, or partitioned queries. Multiplexed sessions can be created via CreateSession but not via BatchCreateSessions. Multiplexed sessions may not be deleted nor listed.
2346+
* Optional. If true, specifies a multiplexed session. Use a multiplexed session for multiple, concurrent read-only operations. Don't use them for read-write transactions, partitioned reads, or partitioned queries. Use CreateSession to create multiplexed sessions. Don't use BatchCreateSessions to create a multiplexed session. You can't delete or list multiplexed sessions.
23392347
*/
23402348
multiplexed?: boolean | null;
23412349
/**
@@ -3166,7 +3174,7 @@ export namespace spanner_v1 {
31663174
}
31673175

31683176
/**
3169-
* Lists the supported instance configurations for a given project.
3177+
* Lists the supported instance configurations for a given project. Returns both Google managed configs and user managed configs.
31703178
*
31713179
* @param params - Parameters for request
31723180
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3398,7 +3406,7 @@ export namespace spanner_v1 {
33983406
export interface Params$Resource$Projects$Instanceconfigs$Patch
33993407
extends StandardParameters {
34003408
/**
3401-
* A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`.
3409+
* A unique identifier for the instance configuration. Values are of the form `projects//instanceConfigs/a-z*`. User instance config must start with `custom-`.
34023410
*/
34033411
name?: string;
34043412

0 commit comments

Comments
 (0)