@google-cloud/spanner 7.9.1 → 7.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/build/protos/google/spanner/admin/database/v1/backup.proto +17 -0
- package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +227 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +60 -0
- package/build/protos/google/spanner/executor/v1/cloud_executor.proto +13 -0
- package/build/protos/google/spanner/v1/spanner.proto +78 -0
- package/build/protos/protos.d.ts +1416 -119
- package/build/protos/protos.js +3011 -2
- package/build/protos/protos.json +382 -11
- package/build/src/database.js +25 -8
- package/build/src/transaction.d.ts +1 -0
- package/build/src/v1/database_admin_client.d.ts +240 -0
- package/build/src/v1/database_admin_client.js +256 -0
- package/build/src/v1/database_admin_client_config.json +25 -0
- package/build/src/v1/database_admin_proto_list.json +1 -0
- package/build/src/v1/spanner_client.d.ts +22 -0
- package/build/src/v1/spanner_client.js +14 -6
- package/build/src/v1/spanner_executor_proxy_client.d.ts +42 -0
- package/build/src/v1/spanner_executor_proxy_client.js +59 -2
- package/build/src/v1/spanner_executor_proxy_proto_list.json +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [7.10.0](https://github.com/googleapis/nodejs-spanner/compare/v7.9.1...v7.10.0) (2024-07-19)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Add field lock_hint in spanner.proto ([47520e9](https://github.com/googleapis/nodejs-spanner/commit/47520e927b0fdcc60cb67378b8b49f44329f210b))
|
|
13
|
+
* Add field order_by in spanner.proto ([47520e9](https://github.com/googleapis/nodejs-spanner/commit/47520e927b0fdcc60cb67378b8b49f44329f210b))
|
|
14
|
+
* Add QueryCancellationAction message in executor protos ([47520e9](https://github.com/googleapis/nodejs-spanner/commit/47520e927b0fdcc60cb67378b8b49f44329f210b))
|
|
15
|
+
* Add support for change streams transaction exclusion option for Batch Write ([#2070](https://github.com/googleapis/nodejs-spanner/issues/2070)) ([2a9e443](https://github.com/googleapis/nodejs-spanner/commit/2a9e44328acda310db2d0d65d32ad82d77a9fcb0))
|
|
16
|
+
* **spanner:** Add support for Cloud Spanner Scheduled Backups ([#2045](https://github.com/googleapis/nodejs-spanner/issues/2045)) ([47520e9](https://github.com/googleapis/nodejs-spanner/commit/47520e927b0fdcc60cb67378b8b49f44329f210b))
|
|
17
|
+
* Update Nodejs generator to send API versions in headers for GAPICs ([47520e9](https://github.com/googleapis/nodejs-spanner/commit/47520e927b0fdcc60cb67378b8b49f44329f210b))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* Callback in getDatabaseDialect ([#2078](https://github.com/googleapis/nodejs-spanner/issues/2078)) ([7e4a8e9](https://github.com/googleapis/nodejs-spanner/commit/7e4a8e9ad4f785b15b68aaa06b6480098d7995ba))
|
|
23
|
+
* **deps:** Update dependency google-gax to v4.3.8 ([#2077](https://github.com/googleapis/nodejs-spanner/issues/2077)) ([e927880](https://github.com/googleapis/nodejs-spanner/commit/e927880ff786a2528a2bbb063a244af3c42ff69c))
|
|
24
|
+
|
|
7
25
|
## [7.9.1](https://github.com/googleapis/nodejs-spanner/compare/v7.9.0...v7.9.1) (2024-06-26)
|
|
8
26
|
|
|
9
27
|
|
|
@@ -156,6 +156,18 @@ message Backup {
|
|
|
156
156
|
// less than `Backup.max_expire_time`.
|
|
157
157
|
google.protobuf.Timestamp max_expire_time = 12
|
|
158
158
|
[(google.api.field_behavior) = OUTPUT_ONLY];
|
|
159
|
+
|
|
160
|
+
// Output only. List of backup schedule URIs that are associated with
|
|
161
|
+
// creating this backup. This is only applicable for scheduled backups, and
|
|
162
|
+
// is empty for on-demand backups.
|
|
163
|
+
//
|
|
164
|
+
// To optimize for storage, whenever possible, multiple schedules are
|
|
165
|
+
// collapsed together to create one backup. In such cases, this field captures
|
|
166
|
+
// the list of all backup schedule URIs that are associated with creating
|
|
167
|
+
// this backup. If collapsing is not done, then this field captures the
|
|
168
|
+
// single backup schedule URI associated with creating this backup.
|
|
169
|
+
repeated string backup_schedules = 14
|
|
170
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
|
159
171
|
}
|
|
160
172
|
|
|
161
173
|
// The request for
|
|
@@ -688,3 +700,8 @@ message CopyBackupEncryptionConfig {
|
|
|
688
700
|
}
|
|
689
701
|
];
|
|
690
702
|
}
|
|
703
|
+
|
|
704
|
+
// The specification for full backups.
|
|
705
|
+
// A full backup stores the entire contents of the database at a given
|
|
706
|
+
// version time.
|
|
707
|
+
message FullBackupSpec {}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// Copyright 2024 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.spanner.admin.database.v1;
|
|
18
|
+
|
|
19
|
+
import "google/api/field_behavior.proto";
|
|
20
|
+
import "google/api/resource.proto";
|
|
21
|
+
import "google/protobuf/duration.proto";
|
|
22
|
+
import "google/protobuf/field_mask.proto";
|
|
23
|
+
import "google/protobuf/timestamp.proto";
|
|
24
|
+
import "google/spanner/admin/database/v1/backup.proto";
|
|
25
|
+
|
|
26
|
+
option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
|
|
27
|
+
option go_package = "cloud.google.com/go/spanner/admin/database/apiv1/databasepb;databasepb";
|
|
28
|
+
option java_multiple_files = true;
|
|
29
|
+
option java_outer_classname = "BackupScheduleProto";
|
|
30
|
+
option java_package = "com.google.spanner.admin.database.v1";
|
|
31
|
+
option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1";
|
|
32
|
+
option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1";
|
|
33
|
+
|
|
34
|
+
// Defines specifications of the backup schedule.
|
|
35
|
+
message BackupScheduleSpec {
|
|
36
|
+
// Required.
|
|
37
|
+
oneof schedule_spec {
|
|
38
|
+
// Cron style schedule specification.
|
|
39
|
+
CrontabSpec cron_spec = 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// BackupSchedule expresses the automated backup creation specification for a
|
|
44
|
+
// Spanner database.
|
|
45
|
+
// Next ID: 10
|
|
46
|
+
message BackupSchedule {
|
|
47
|
+
option (google.api.resource) = {
|
|
48
|
+
type: "spanner.googleapis.com/BackupSchedule"
|
|
49
|
+
pattern: "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}"
|
|
50
|
+
plural: "backupSchedules"
|
|
51
|
+
singular: "backupSchedule"
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Identifier. Output only for the
|
|
55
|
+
// [CreateBackupSchedule][DatabaseAdmin.CreateBackupSchededule] operation.
|
|
56
|
+
// Required for the
|
|
57
|
+
// [UpdateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule]
|
|
58
|
+
// operation. A globally unique identifier for the backup schedule which
|
|
59
|
+
// cannot be changed. Values are of the form
|
|
60
|
+
// `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/[a-z][a-z0-9_\-]*[a-z0-9]`
|
|
61
|
+
// The final segment of the name must be between 2 and 60 characters in
|
|
62
|
+
// length.
|
|
63
|
+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
|
|
64
|
+
|
|
65
|
+
// Optional. The schedule specification based on which the backup creations
|
|
66
|
+
// are triggered.
|
|
67
|
+
BackupScheduleSpec spec = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
68
|
+
|
|
69
|
+
// Optional. The retention duration of a backup that must be at least 6 hours
|
|
70
|
+
// and at most 366 days. The backup is eligible to be automatically deleted
|
|
71
|
+
// once the retention period has elapsed.
|
|
72
|
+
google.protobuf.Duration retention_duration = 3
|
|
73
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
74
|
+
|
|
75
|
+
// Optional. The encryption configuration that will be used to encrypt the
|
|
76
|
+
// backup. If this field is not specified, the backup will use the same
|
|
77
|
+
// encryption configuration as the database.
|
|
78
|
+
CreateBackupEncryptionConfig encryption_config = 4
|
|
79
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
80
|
+
|
|
81
|
+
// Required. Backup type spec determines the type of backup that is created by
|
|
82
|
+
// the backup schedule. Currently, only full backups are supported.
|
|
83
|
+
oneof backup_type_spec {
|
|
84
|
+
// The schedule creates only full backups.
|
|
85
|
+
FullBackupSpec full_backup_spec = 7;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Output only. The timestamp at which the schedule was last updated.
|
|
89
|
+
// If the schedule has never been updated, this field contains the timestamp
|
|
90
|
+
// when the schedule was first created.
|
|
91
|
+
google.protobuf.Timestamp update_time = 9
|
|
92
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// CrontabSpec can be used to specify the version time and frequency at
|
|
96
|
+
// which the backup should be created.
|
|
97
|
+
message CrontabSpec {
|
|
98
|
+
// Required. Textual representation of the crontab. User can customize the
|
|
99
|
+
// backup frequency and the backup version time using the cron
|
|
100
|
+
// expression. The version time must be in UTC timzeone.
|
|
101
|
+
//
|
|
102
|
+
// The backup will contain an externally consistent copy of the
|
|
103
|
+
// database at the version time. Allowed frequencies are 12 hour, 1 day,
|
|
104
|
+
// 1 week and 1 month. Examples of valid cron specifications:
|
|
105
|
+
// * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.
|
|
106
|
+
// * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.
|
|
107
|
+
// * `0 2 * * * ` : once a day at 2 past midnight in UTC.
|
|
108
|
+
// * `0 2 * * 0 ` : once a week every Sunday at 2 past midnight in UTC.
|
|
109
|
+
// * `0 2 8 * * ` : once a month on 8th day at 2 past midnight in UTC.
|
|
110
|
+
string text = 1 [(google.api.field_behavior) = REQUIRED];
|
|
111
|
+
|
|
112
|
+
// Output only. The time zone of the times in `CrontabSpec.text`. Currently
|
|
113
|
+
// only UTC is supported.
|
|
114
|
+
string time_zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
115
|
+
|
|
116
|
+
// Output only. Schedule backups will contain an externally consistent copy
|
|
117
|
+
// of the database at the version time specified in
|
|
118
|
+
// `schedule_spec.cron_spec`. However, Spanner may not initiate the creation
|
|
119
|
+
// of the scheduled backups at that version time. Spanner will initiate
|
|
120
|
+
// the creation of scheduled backups within the time window bounded by the
|
|
121
|
+
// version_time specified in `schedule_spec.cron_spec` and version_time +
|
|
122
|
+
// `creation_window`.
|
|
123
|
+
google.protobuf.Duration creation_window = 3
|
|
124
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// The request for
|
|
128
|
+
// [CreateBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackupSchedule].
|
|
129
|
+
message CreateBackupScheduleRequest {
|
|
130
|
+
// Required. The name of the database that this backup schedule applies to.
|
|
131
|
+
string parent = 1 [
|
|
132
|
+
(google.api.field_behavior) = REQUIRED,
|
|
133
|
+
(google.api.resource_reference) = {
|
|
134
|
+
type: "spanner.googleapis.com/Database"
|
|
135
|
+
}
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
// Required. The Id to use for the backup schedule. The `backup_schedule_id`
|
|
139
|
+
// appended to `parent` forms the full backup schedule name of the form
|
|
140
|
+
// `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
|
141
|
+
string backup_schedule_id = 2 [(google.api.field_behavior) = REQUIRED];
|
|
142
|
+
|
|
143
|
+
// Required. The backup schedule to create.
|
|
144
|
+
BackupSchedule backup_schedule = 3 [(google.api.field_behavior) = REQUIRED];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// The request for
|
|
148
|
+
// [GetBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.GetBackupSchedule].
|
|
149
|
+
message GetBackupScheduleRequest {
|
|
150
|
+
// Required. The name of the schedule to retrieve.
|
|
151
|
+
// Values are of the form
|
|
152
|
+
// `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
|
153
|
+
string name = 1 [
|
|
154
|
+
(google.api.field_behavior) = REQUIRED,
|
|
155
|
+
(google.api.resource_reference) = {
|
|
156
|
+
type: "spanner.googleapis.com/BackupSchedule"
|
|
157
|
+
}
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// The request for
|
|
162
|
+
// [DeleteBackupSchedule][google.spanner.admin.database.v1.DatabaseAdmin.DeleteBackupSchedule].
|
|
163
|
+
message DeleteBackupScheduleRequest {
|
|
164
|
+
// Required. The name of the schedule to delete.
|
|
165
|
+
// Values are of the form
|
|
166
|
+
// `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
|
167
|
+
string name = 1 [
|
|
168
|
+
(google.api.field_behavior) = REQUIRED,
|
|
169
|
+
(google.api.resource_reference) = {
|
|
170
|
+
type: "spanner.googleapis.com/BackupSchedule"
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// The request for
|
|
176
|
+
// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules].
|
|
177
|
+
message ListBackupSchedulesRequest {
|
|
178
|
+
// Required. Database is the parent resource whose backup schedules should be
|
|
179
|
+
// listed. Values are of the form
|
|
180
|
+
// projects/<project>/instances/<instance>/databases/<database>
|
|
181
|
+
string parent = 1 [
|
|
182
|
+
(google.api.field_behavior) = REQUIRED,
|
|
183
|
+
(google.api.resource_reference) = {
|
|
184
|
+
type: "spanner.googleapis.com/Database"
|
|
185
|
+
}
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
// Optional. Number of backup schedules to be returned in the response. If 0
|
|
189
|
+
// or less, defaults to the server's maximum allowed page size.
|
|
190
|
+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
191
|
+
|
|
192
|
+
// Optional. If non-empty, `page_token` should contain a
|
|
193
|
+
// [next_page_token][google.spanner.admin.database.v1.ListBackupSchedulesResponse.next_page_token]
|
|
194
|
+
// from a previous
|
|
195
|
+
// [ListBackupSchedulesResponse][google.spanner.admin.database.v1.ListBackupSchedulesResponse]
|
|
196
|
+
// to the same `parent`.
|
|
197
|
+
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// The response for
|
|
201
|
+
// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules].
|
|
202
|
+
message ListBackupSchedulesResponse {
|
|
203
|
+
// The list of backup schedules for a database.
|
|
204
|
+
repeated BackupSchedule backup_schedules = 1;
|
|
205
|
+
|
|
206
|
+
// `next_page_token` can be sent in a subsequent
|
|
207
|
+
// [ListBackupSchedules][google.spanner.admin.database.v1.DatabaseAdmin.ListBackupSchedules]
|
|
208
|
+
// call to fetch more of the schedules.
|
|
209
|
+
string next_page_token = 2;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// The request for
|
|
213
|
+
// [UpdateBackupScheduleRequest][google.spanner.admin.database.v1.DatabaseAdmin.UpdateBackupSchedule].
|
|
214
|
+
message UpdateBackupScheduleRequest {
|
|
215
|
+
// Required. The backup schedule to update. `backup_schedule.name`, and the
|
|
216
|
+
// fields to be updated as specified by `update_mask` are required. Other
|
|
217
|
+
// fields are ignored.
|
|
218
|
+
BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED];
|
|
219
|
+
|
|
220
|
+
// Required. A mask specifying which fields in the BackupSchedule resource
|
|
221
|
+
// should be updated. This mask is relative to the BackupSchedule resource,
|
|
222
|
+
// not to the request message. The field mask must always be
|
|
223
|
+
// specified; this prevents any future fields from being erased
|
|
224
|
+
// accidentally.
|
|
225
|
+
google.protobuf.FieldMask update_mask = 2
|
|
226
|
+
[(google.api.field_behavior) = REQUIRED];
|
|
227
|
+
}
|
|
@@ -27,6 +27,7 @@ import "google/protobuf/empty.proto";
|
|
|
27
27
|
import "google/protobuf/field_mask.proto";
|
|
28
28
|
import "google/protobuf/timestamp.proto";
|
|
29
29
|
import "google/spanner/admin/database/v1/backup.proto";
|
|
30
|
+
import "google/spanner/admin/database/v1/backup_schedule.proto";
|
|
30
31
|
import "google/spanner/admin/database/v1/common.proto";
|
|
31
32
|
|
|
32
33
|
option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
|
|
@@ -199,6 +200,10 @@ service DatabaseAdmin {
|
|
|
199
200
|
post: "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy"
|
|
200
201
|
body: "*"
|
|
201
202
|
}
|
|
203
|
+
additional_bindings {
|
|
204
|
+
post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy"
|
|
205
|
+
body: "*"
|
|
206
|
+
}
|
|
202
207
|
};
|
|
203
208
|
option (google.api.method_signature) = "resource,policy";
|
|
204
209
|
}
|
|
@@ -220,6 +225,10 @@ service DatabaseAdmin {
|
|
|
220
225
|
post: "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy"
|
|
221
226
|
body: "*"
|
|
222
227
|
}
|
|
228
|
+
additional_bindings {
|
|
229
|
+
post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy"
|
|
230
|
+
body: "*"
|
|
231
|
+
}
|
|
223
232
|
};
|
|
224
233
|
option (google.api.method_signature) = "resource";
|
|
225
234
|
}
|
|
@@ -243,6 +252,10 @@ service DatabaseAdmin {
|
|
|
243
252
|
post: "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions"
|
|
244
253
|
body: "*"
|
|
245
254
|
}
|
|
255
|
+
additional_bindings {
|
|
256
|
+
post: "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions"
|
|
257
|
+
body: "*"
|
|
258
|
+
}
|
|
246
259
|
additional_bindings {
|
|
247
260
|
post: "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions"
|
|
248
261
|
body: "*"
|
|
@@ -411,6 +424,53 @@ service DatabaseAdmin {
|
|
|
411
424
|
};
|
|
412
425
|
option (google.api.method_signature) = "parent";
|
|
413
426
|
}
|
|
427
|
+
|
|
428
|
+
// Creates a new backup schedule.
|
|
429
|
+
rpc CreateBackupSchedule(CreateBackupScheduleRequest)
|
|
430
|
+
returns (BackupSchedule) {
|
|
431
|
+
option (google.api.http) = {
|
|
432
|
+
post: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules"
|
|
433
|
+
body: "backup_schedule"
|
|
434
|
+
};
|
|
435
|
+
option (google.api.method_signature) =
|
|
436
|
+
"parent,backup_schedule,backup_schedule_id";
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// Gets backup schedule for the input schedule name.
|
|
440
|
+
rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) {
|
|
441
|
+
option (google.api.http) = {
|
|
442
|
+
get: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}"
|
|
443
|
+
};
|
|
444
|
+
option (google.api.method_signature) = "name";
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// Updates a backup schedule.
|
|
448
|
+
rpc UpdateBackupSchedule(UpdateBackupScheduleRequest)
|
|
449
|
+
returns (BackupSchedule) {
|
|
450
|
+
option (google.api.http) = {
|
|
451
|
+
patch: "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}"
|
|
452
|
+
body: "backup_schedule"
|
|
453
|
+
};
|
|
454
|
+
option (google.api.method_signature) = "backup_schedule,update_mask";
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Deletes a backup schedule.
|
|
458
|
+
rpc DeleteBackupSchedule(DeleteBackupScheduleRequest)
|
|
459
|
+
returns (google.protobuf.Empty) {
|
|
460
|
+
option (google.api.http) = {
|
|
461
|
+
delete: "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}"
|
|
462
|
+
};
|
|
463
|
+
option (google.api.method_signature) = "name";
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// Lists all the backup schedules for the database.
|
|
467
|
+
rpc ListBackupSchedules(ListBackupSchedulesRequest)
|
|
468
|
+
returns (ListBackupSchedulesResponse) {
|
|
469
|
+
option (google.api.http) = {
|
|
470
|
+
get: "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules"
|
|
471
|
+
};
|
|
472
|
+
option (google.api.method_signature) = "parent";
|
|
473
|
+
}
|
|
414
474
|
}
|
|
415
475
|
|
|
416
476
|
// Information about the database restore.
|
|
@@ -132,6 +132,9 @@ message SpannerAction {
|
|
|
132
132
|
|
|
133
133
|
// Action to execute change stream query.
|
|
134
134
|
ExecuteChangeStreamQuery execute_change_stream_query = 50;
|
|
135
|
+
|
|
136
|
+
// Query cancellation action for testing the cancellation of a query.
|
|
137
|
+
QueryCancellationAction query_cancellation = 51;
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
|
|
@@ -1048,6 +1051,16 @@ message GetOperationAction {
|
|
|
1048
1051
|
string operation = 1;
|
|
1049
1052
|
}
|
|
1050
1053
|
|
|
1054
|
+
// Query cancellation action defines the long running query and the cancel query
|
|
1055
|
+
// format depening on the Cloud database dialect.
|
|
1056
|
+
message QueryCancellationAction {
|
|
1057
|
+
// Long running query.
|
|
1058
|
+
string long_running_sql = 1;
|
|
1059
|
+
|
|
1060
|
+
// Format of the cancel query for the cloud database dialect.
|
|
1061
|
+
string cancel_query = 2;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1051
1064
|
// Action that cancels an operation.
|
|
1052
1065
|
message CancelOperationAction {
|
|
1053
1066
|
// The name of the operation resource to be cancelled.
|
|
@@ -1043,6 +1043,71 @@ message PartitionResponse {
|
|
|
1043
1043
|
// The request for [Read][google.spanner.v1.Spanner.Read] and
|
|
1044
1044
|
// [StreamingRead][google.spanner.v1.Spanner.StreamingRead].
|
|
1045
1045
|
message ReadRequest {
|
|
1046
|
+
// An option to control the order in which rows are returned from a read.
|
|
1047
|
+
enum OrderBy {
|
|
1048
|
+
// Default value.
|
|
1049
|
+
//
|
|
1050
|
+
// ORDER_BY_UNSPECIFIED is equivalent to ORDER_BY_PRIMARY_KEY.
|
|
1051
|
+
ORDER_BY_UNSPECIFIED = 0;
|
|
1052
|
+
|
|
1053
|
+
// Read rows are returned in primary key order.
|
|
1054
|
+
//
|
|
1055
|
+
// In the event that this option is used in conjunction with the
|
|
1056
|
+
// `partition_token` field, the API will return an `INVALID_ARGUMENT` error.
|
|
1057
|
+
ORDER_BY_PRIMARY_KEY = 1;
|
|
1058
|
+
|
|
1059
|
+
// Read rows are returned in any order.
|
|
1060
|
+
ORDER_BY_NO_ORDER = 2;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// A lock hint mechanism for reads done within a transaction.
|
|
1064
|
+
enum LockHint {
|
|
1065
|
+
// Default value.
|
|
1066
|
+
//
|
|
1067
|
+
// LOCK_HINT_UNSPECIFIED is equivalent to LOCK_HINT_SHARED.
|
|
1068
|
+
LOCK_HINT_UNSPECIFIED = 0;
|
|
1069
|
+
|
|
1070
|
+
// Acquire shared locks.
|
|
1071
|
+
//
|
|
1072
|
+
// By default when you perform a read as part of a read-write transaction,
|
|
1073
|
+
// Spanner acquires shared read locks, which allows other reads to still
|
|
1074
|
+
// access the data until your transaction is ready to commit. When your
|
|
1075
|
+
// transaction is committing and writes are being applied, the transaction
|
|
1076
|
+
// attempts to upgrade to an exclusive lock for any data you are writing.
|
|
1077
|
+
// For more information about locks, see [Lock
|
|
1078
|
+
// modes](https://cloud.google.com/spanner/docs/introspection/lock-statistics#explain-lock-modes).
|
|
1079
|
+
LOCK_HINT_SHARED = 1;
|
|
1080
|
+
|
|
1081
|
+
// Acquire exclusive locks.
|
|
1082
|
+
//
|
|
1083
|
+
// Requesting exclusive locks is beneficial if you observe high write
|
|
1084
|
+
// contention, which means you notice that multiple transactions are
|
|
1085
|
+
// concurrently trying to read and write to the same data, resulting in a
|
|
1086
|
+
// large number of aborts. This problem occurs when two transactions
|
|
1087
|
+
// initially acquire shared locks and then both try to upgrade to exclusive
|
|
1088
|
+
// locks at the same time. In this situation both transactions are waiting
|
|
1089
|
+
// for the other to give up their lock, resulting in a deadlocked situation.
|
|
1090
|
+
// Spanner is able to detect this occurring and force one of the
|
|
1091
|
+
// transactions to abort. However, this is a slow and expensive operation
|
|
1092
|
+
// and results in lower performance. In this case it makes sense to acquire
|
|
1093
|
+
// exclusive locks at the start of the transaction because then when
|
|
1094
|
+
// multiple transactions try to act on the same data, they automatically get
|
|
1095
|
+
// serialized. Each transaction waits its turn to acquire the lock and
|
|
1096
|
+
// avoids getting into deadlock situations.
|
|
1097
|
+
//
|
|
1098
|
+
// Because the exclusive lock hint is just a hint, it should not be
|
|
1099
|
+
// considered equivalent to a mutex. In other words, you should not use
|
|
1100
|
+
// Spanner exclusive locks as a mutual exclusion mechanism for the execution
|
|
1101
|
+
// of code outside of Spanner.
|
|
1102
|
+
//
|
|
1103
|
+
// **Note:** Request exclusive locks judiciously because they block others
|
|
1104
|
+
// from reading that data for the entire transaction, rather than just when
|
|
1105
|
+
// the writes are being performed. Unless you observe high write contention,
|
|
1106
|
+
// you should use the default of shared read locks so you don't prematurely
|
|
1107
|
+
// block other clients from reading the data that you're writing to.
|
|
1108
|
+
LOCK_HINT_EXCLUSIVE = 2;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1046
1111
|
// Required. The session in which the read should be performed.
|
|
1047
1112
|
string session = 1 [
|
|
1048
1113
|
(google.api.field_behavior) = REQUIRED,
|
|
@@ -1117,6 +1182,19 @@ message ReadRequest {
|
|
|
1117
1182
|
// If the field is set to `true` but the request does not set
|
|
1118
1183
|
// `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
1119
1184
|
bool data_boost_enabled = 15;
|
|
1185
|
+
|
|
1186
|
+
// Optional. Order for the returned rows.
|
|
1187
|
+
//
|
|
1188
|
+
// By default, Spanner will return result rows in primary key order except for
|
|
1189
|
+
// PartitionRead requests. For applications that do not require rows to be
|
|
1190
|
+
// returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
|
|
1191
|
+
// `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
|
|
1192
|
+
// resulting in lower latencies in certain cases (e.g. bulk point lookups).
|
|
1193
|
+
OrderBy order_by = 16 [(google.api.field_behavior) = OPTIONAL];
|
|
1194
|
+
|
|
1195
|
+
// Optional. Lock Hint for the request, it can only be used with read-write
|
|
1196
|
+
// transactions.
|
|
1197
|
+
LockHint lock_hint = 17 [(google.api.field_behavior) = OPTIONAL];
|
|
1120
1198
|
}
|
|
1121
1199
|
|
|
1122
1200
|
// The request for
|