-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcloud_executor.proto
1467 lines (1139 loc) · 47.4 KB
/
cloud_executor.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.spanner.executor.v1;
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
import "google/spanner/admin/database/v1/backup.proto";
import "google/spanner/admin/database/v1/common.proto";
import "google/spanner/admin/database/v1/spanner_database_admin.proto";
import "google/spanner/admin/instance/v1/spanner_instance_admin.proto";
import "google/spanner/v1/spanner.proto";
import "google/spanner/v1/type.proto";
option go_package = "cloud.google.com/go/spanner/executor/apiv1/executorpb;executorpb";
option java_multiple_files = true;
option java_outer_classname = "CloudExecutorProto";
option java_package = "com.google.spanner.executor.v1";
// Service that executes SpannerActions asynchronously.
service SpannerExecutorProxy {
option (google.api.default_host) = "spanner-cloud-executor.googleapis.com";
// ExecuteActionAsync is a streaming call that starts executing a new Spanner
// action.
//
// For each request, the server will reply with one or more responses, but
// only the last response will contain status in the outcome.
//
// Responses can be matched to requests by action_id. It is allowed to have
// multiple actions in flight--in that case, actions are be executed in
// parallel.
rpc ExecuteActionAsync(stream SpannerAsyncActionRequest)
returns (stream SpannerAsyncActionResponse) {}
}
// Request to executor service that start a new Spanner action.
message SpannerAsyncActionRequest {
// Action id to uniquely identify this action request.
int32 action_id = 1;
// The actual SpannerAction to perform.
SpannerAction action = 2;
}
// Response from executor service.
message SpannerAsyncActionResponse {
// Action id corresponds to the request.
int32 action_id = 1;
// If action results are split into multiple responses, only the last response
// can and should contain status.
SpannerActionOutcome outcome = 2;
}
// SpannerAction defines a primitive action that can be performed against
// Spanner, such as begin or commit a transaction, or perform a read or
// mutation.
message SpannerAction {
// Database against which to perform action.
// In a context where a series of actions take place, an action may omit
// database path if it applies to the same database as the previous action.
string database_path = 1;
// Action represents a spanner action kind, there will only be one action kind
// per SpannerAction.
oneof action {
// Action to start a transaction.
StartTransactionAction start = 10;
// Action to finish a transaction.
FinishTransactionAction finish = 11;
// Action to do a normal read.
ReadAction read = 20;
// Action to do a query.
QueryAction query = 21;
// Action to buffer a mutation.
MutationAction mutation = 22;
// Action to a DML.
DmlAction dml = 23;
// Action to a batch DML.
BatchDmlAction batch_dml = 24;
// Action to write a mutation.
WriteMutationsAction write = 25;
// Action to a partitioned update.
PartitionedUpdateAction partitioned_update = 27;
// Action that contains any administrative operation, like database,
// instance manipulation.
AdminAction admin = 30;
// Action to start a batch transaction.
StartBatchTransactionAction start_batch_txn = 40;
// Action to close a batch transaction.
CloseBatchTransactionAction close_batch_txn = 41;
// Action to generate database partitions for batch read.
GenerateDbPartitionsForReadAction generate_db_partitions_read = 42;
// Action to generate database partitions for batch query.
GenerateDbPartitionsForQueryAction generate_db_partitions_query = 43;
// Action to execute batch actions on generated partitions.
ExecutePartitionAction execute_partition = 44;
// Action to execute change stream query.
ExecuteChangeStreamQuery execute_change_stream_query = 50;
}
}
// A single read request.
message ReadAction {
// The table to read at.
string table = 1;
// The index to read at if it's an index read.
optional string index = 2;
// List of columns must begin with the key columns used for the read.
repeated string column = 3;
// Keys for performing this read.
KeySet keys = 4;
// Limit on number of rows to read. If set, must be positive.
int32 limit = 5;
}
// A SQL query request.
message QueryAction {
// Parameter that bind to placeholders in the SQL string
message Parameter {
// Name of the parameter (with no leading @).
string name = 1;
// Type of the parameter.
google.spanner.v1.Type type = 2;
// Value of the parameter.
Value value = 3;
}
// The SQL string.
string sql = 1;
// Parameters for the SQL string.
repeated Parameter params = 2;
}
// A single DML statement.
message DmlAction {
// DML statement.
QueryAction update = 1;
// Whether to autocommit the transaction after executing the DML statement,
// if the Executor supports autocommit.
optional bool autocommit_if_supported = 2;
}
// Batch of DML statements invoked using batched execution.
message BatchDmlAction {
// DML statements.
repeated QueryAction updates = 1;
}
// Value represents a single value that can be read or written to/from
// Spanner.
message Value {
// Exactly one of the following fields will be present.
oneof value_type {
// If is_null is set, then this value is null.
bool is_null = 1;
// Int type value. It's used for all integer number types, like int32 and
// int64.
int64 int_value = 2;
// Bool type value.
bool bool_value = 3;
// Double type value. It's used for all float point types, like float and
// double.
double double_value = 4;
// Bytes type value, stored in CORD. It's also used for PROTO type value.
bytes bytes_value = 5;
// String type value, stored in CORD.
string string_value = 6;
// Struct type value. It contains a ValueList representing the values in
// this struct.
ValueList struct_value = 7;
// Timestamp type value.
google.protobuf.Timestamp timestamp_value = 8;
// Date type value. Date is specified as a number of days since Unix epoch.
int32 date_days_value = 9;
// If set, holds the sentinel value for the transaction CommitTimestamp.
bool is_commit_timestamp = 10;
// Array type value. The underlying Valuelist should have values that have
// the same type.
ValueList array_value = 11;
}
// Type of array element. Only set if value is an array.
optional google.spanner.v1.Type array_type = 12;
}
// 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 "ValueList", where the ith value in the list
// corresponds to the ith component of the table or index primary key.
message KeyRange {
// Type controls whether "start" and "limit" are open or closed. By default,
// "start" is closed, and "limit" is open.
enum Type {
// "TYPE_UNSPECIFIED" is equivalent to "CLOSED_OPEN".
TYPE_UNSPECIFIED = 0;
// [start,limit]
CLOSED_CLOSED = 1;
// [start,limit)
CLOSED_OPEN = 2;
// (start,limit]
OPEN_CLOSED = 3;
// (start,limit)
OPEN_OPEN = 4;
}
// "start" and "limit" must have the same number of key parts,
// though they may name only a prefix of the table or index key.
// The start key of this KeyRange.
ValueList start = 1;
// The end key of this KeyRange.
ValueList limit = 2;
// "start" and "limit" type for this KeyRange.
optional Type type = 3;
}
// KeySet defines a collection of Spanner keys and/or key ranges. All
// the keys are expected to be in the same table. The keys need not be
// sorted in any particular way.
message KeySet {
// 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.
repeated ValueList point = 1;
// A list of key ranges.
repeated KeyRange range = 2;
// 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.
bool all = 3;
}
// List of values.
message ValueList {
// Values contained in this ValueList.
repeated Value value = 1;
}
// A single mutation request.
message MutationAction {
// Arguments to Insert, InsertOrUpdate, and Replace operations.
message InsertArgs {
// The names of the columns to be written.
repeated string column = 1;
// Type information for the "values" entries below.
repeated google.spanner.v1.Type type = 2;
// The values to be written.
repeated ValueList values = 3;
}
// Arguments to Update.
message UpdateArgs {
// The columns to be updated. Identical to InsertArgs.column.
repeated string column = 1;
// Type information for "values". Identical to InsertArgs.type.
repeated google.spanner.v1.Type type = 2;
// The values to be updated. Identical to InsertArgs.values.
repeated ValueList values = 3;
}
// Mod represents the write action that will be perform to a table. Each mod
// will specify exactly one action, from insert, update, insert_or_update,
// replace and delete.
message Mod {
// The table to write.
string table = 1;
// Exactly one of the remaining elements may be present.
// Insert new rows into "table".
InsertArgs insert = 2;
// Update columns stored in existing rows of "table".
UpdateArgs update = 3;
// Insert or update existing rows of "table".
InsertArgs insert_or_update = 4;
// Replace existing rows of "table".
InsertArgs replace = 5;
// Delete rows from "table".
KeySet delete_keys = 6;
}
// Mods that contained in this mutation.
repeated Mod mod = 1;
}
// WriteMutationAction defines an action of flushing the mutation so they
// are visible to subsequent operations in the transaction.
message WriteMutationsAction {
// The mutation to write.
MutationAction mutation = 1;
}
// PartitionedUpdateAction defines an action to execute a partitioned DML
// which runs different partitions in parallel.
message PartitionedUpdateAction {
message ExecutePartitionedUpdateOptions {
// RPC Priority
optional google.spanner.v1.RequestOptions.Priority rpc_priority = 1;
// Transaction tag
optional string tag = 2;
}
// Options for partitioned update.
optional ExecutePartitionedUpdateOptions options = 1;
// Partitioned dml query.
QueryAction update = 2;
}
// StartTransactionAction defines an action of initializing a transaction.
message StartTransactionAction {
// Concurrency is for read-only transactions and must be omitted for
// read-write transactions.
optional Concurrency concurrency = 1;
// Metadata about tables and columns that will be involved in this
// transaction. It is to convert values of key parts correctly.
repeated TableMetadata table = 2;
// Transaction_seed contains workid and op pair for this transaction, used for
// testing.
string transaction_seed = 3;
// Execution options (e.g., whether transaction is opaque, optimistic).
optional TransactionExecutionOptions execution_options = 4;
}
// Concurrency for read-only transactions.
message Concurrency {
// Concurrency mode set for read-only transactions, exactly one mode below
// should be set.
oneof concurrency_mode {
// Indicates a read at a consistent timestamp that is specified relative to
// now. That is, if the caller has specified an exact staleness of s
// seconds, we will read at now - s.
double staleness_seconds = 1;
// Indicates a boundedly stale read that reads at a timestamp >= T.
int64 min_read_timestamp_micros = 2;
// Indicates a boundedly stale read that is at most N seconds stale.
double max_staleness_seconds = 3;
// Indicates a read at a consistent timestamp.
int64 exact_timestamp_micros = 4;
// Indicates a strong read, must only be set to true, or unset.
bool strong = 5;
// Indicates a batch read, must only be set to true, or unset.
bool batch = 6;
}
// True if exact_timestamp_micros is set, and the chosen timestamp is that of
// a snapshot epoch.
bool snapshot_epoch_read = 7;
// If set, this is a snapshot epoch read constrained to read only the
// specified log scope root table, and its children. Will not be set for full
// database epochs.
string snapshot_epoch_root_table = 8;
// Set only when batch is true.
int64 batch_read_timestamp_micros = 9;
}
// TableMetadata contains metadata of a single table.
message TableMetadata {
// Table name.
string name = 1;
// Columns, in the same order as in the schema.
repeated ColumnMetadata column = 2;
// Keys, in order. Column name is currently not populated.
repeated ColumnMetadata key_column = 3;
}
// ColumnMetadata represents metadata of a single column.
message ColumnMetadata {
// Column name.
string name = 1;
// Column type.
google.spanner.v1.Type type = 2;
}
// Options for executing the transaction.
message TransactionExecutionOptions {
// Whether optimistic concurrency should be used to execute this transaction.
bool optimistic = 1;
}
// FinishTransactionAction defines an action of finishing a transaction.
message FinishTransactionAction {
// Mode indicates how the transaction should be finished.
enum Mode {
// "MODE_UNSPECIFIED" is equivalent to "COMMIT".
MODE_UNSPECIFIED = 0;
// Commit the transaction.
COMMIT = 1;
// Drop the transaction without committing it.
ABANDON = 2;
}
// Defines how exactly the transaction should be completed, e.g. with
// commit or abortion.
Mode mode = 1;
}
// AdminAction defines all the cloud spanner admin actions, including
// instance/database admin ops, backup ops and operation actions.
message AdminAction {
// Exactly one of the actions below will be performed in AdminAction.
oneof action {
// Action that creates a user instance config.
CreateUserInstanceConfigAction create_user_instance_config = 1;
// Action that updates a user instance config.
UpdateUserInstanceConfigAction update_user_instance_config = 2;
// Action that deletes a user instance config.
DeleteUserInstanceConfigAction delete_user_instance_config = 3;
// Action that gets a user instance config.
GetCloudInstanceConfigAction get_cloud_instance_config = 4;
// Action that lists user instance configs.
ListCloudInstanceConfigsAction list_instance_configs = 5;
// Action that creates a Cloud Spanner instance.
CreateCloudInstanceAction create_cloud_instance = 6;
// Action that updates a Cloud Spanner instance.
UpdateCloudInstanceAction update_cloud_instance = 7;
// Action that deletes a Cloud Spanner instance.
DeleteCloudInstanceAction delete_cloud_instance = 8;
// Action that lists Cloud Spanner instances.
ListCloudInstancesAction list_cloud_instances = 9;
// Action that retrieves a Cloud Spanner instance.
GetCloudInstanceAction get_cloud_instance = 10;
// Action that creates a Cloud Spanner database.
CreateCloudDatabaseAction create_cloud_database = 11;
// Action that updates the schema of a Cloud Spanner database.
UpdateCloudDatabaseDdlAction update_cloud_database_ddl = 12;
// Action that updates the schema of a Cloud Spanner database.
UpdateCloudDatabaseAction update_cloud_database = 27;
// Action that drops a Cloud Spanner database.
DropCloudDatabaseAction drop_cloud_database = 13;
// Action that lists Cloud Spanner databases.
ListCloudDatabasesAction list_cloud_databases = 14;
// Action that lists Cloud Spanner database operations.
ListCloudDatabaseOperationsAction list_cloud_database_operations = 15;
// Action that restores a Cloud Spanner database from a backup.
RestoreCloudDatabaseAction restore_cloud_database = 16;
// Action that gets a Cloud Spanner database.
GetCloudDatabaseAction get_cloud_database = 17;
// Action that creates a Cloud Spanner database backup.
CreateCloudBackupAction create_cloud_backup = 18;
// Action that copies a Cloud Spanner database backup.
CopyCloudBackupAction copy_cloud_backup = 19;
// Action that gets a Cloud Spanner database backup.
GetCloudBackupAction get_cloud_backup = 20;
// Action that updates a Cloud Spanner database backup.
UpdateCloudBackupAction update_cloud_backup = 21;
// Action that deletes a Cloud Spanner database backup.
DeleteCloudBackupAction delete_cloud_backup = 22;
// Action that lists Cloud Spanner database backups.
ListCloudBackupsAction list_cloud_backups = 23;
// Action that lists Cloud Spanner database backup operations.
ListCloudBackupOperationsAction list_cloud_backup_operations = 24;
// Action that gets an operation.
GetOperationAction get_operation = 25;
// Action that cancels an operation.
CancelOperationAction cancel_operation = 26;
}
}
// Action that creates a user instance config.
message CreateUserInstanceConfigAction {
// User instance config ID (not path), e.g. "custom-config".
string user_config_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
// Base config ID, e.g. "test-config".
string base_config_id = 3;
// Replicas that should be included in the user config.
repeated google.spanner.admin.instance.v1.ReplicaInfo replicas = 4;
}
// Action that updates a user instance config.
message UpdateUserInstanceConfigAction {
// User instance config ID (not path), e.g. "custom-config".
string user_config_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
// The descriptive name for this instance config as it appears in UIs.
optional string display_name = 3;
// labels.
map<string, string> labels = 4;
}
// Action that gets a user instance config.
message GetCloudInstanceConfigAction {
// Instance config ID (not path), e.g. "custom-config".
string instance_config_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
}
// Action that deletes a user instance configs.
message DeleteUserInstanceConfigAction {
// User instance config ID (not path), e.g. "custom-config".
string user_config_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
}
// Action that lists user instance configs.
message ListCloudInstanceConfigsAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Number of instance configs to be returned in the response. If 0 or
// less, defaults to the server's maximum allowed page size.
optional int32 page_size = 2;
// If non-empty, "page_token" should contain a next_page_token
// from a previous ListInstanceConfigsResponse to the same "parent".
optional string page_token = 3;
}
// Action that creates a Cloud Spanner instance.
message CreateCloudInstanceAction {
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
// Instance config ID, e.g. "test-config".
string instance_config_id = 3;
// Number of nodes (processing_units should not be set or set to 0 if used).
optional int32 node_count = 4;
// Number of processing units (node_count should be set to 0 if used).
optional int32 processing_units = 6;
// The autoscaling config for this instance. If non-empty, an autoscaling
// instance will be created (processing_units and node_count should be set to
// 0 if used).
optional google.spanner.admin.instance.v1.AutoscalingConfig
autoscaling_config = 7;
// labels.
map<string, string> labels = 5;
}
// Action that updates a Cloud Spanner instance.
message UpdateCloudInstanceAction {
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
// The descriptive name for this instance as it appears in UIs.
// Must be unique per project and between 4 and 30 characters in length.
optional string display_name = 3;
// The number of nodes allocated to this instance. At most one of either
// node_count or processing_units should be present in the message.
optional int32 node_count = 4;
// The number of processing units allocated to this instance. At most one of
// processing_units or node_count should be present in the message.
optional int32 processing_units = 5;
// The autoscaling config for this instance. If non-empty, this instance is
// using autoscaling (processing_units and node_count should be set to
// 0 if used).
optional google.spanner.admin.instance.v1.AutoscalingConfig
autoscaling_config = 7;
// labels.
map<string, string> labels = 6;
}
// Action that deletes a Cloud Spanner instance.
message DeleteCloudInstanceAction {
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
}
// Action that creates a Cloud Spanner database.
message CreateCloudDatabaseAction {
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
// Cloud database ID (not full path), e.g. "db0".
string database_id = 3;
// SDL statements to apply to the new database.
repeated string sdl_statement = 4;
// The KMS key used to encrypt the database to be created if the database
// should be CMEK protected.
google.spanner.admin.database.v1.EncryptionConfig encryption_config = 5;
// Optional SQL dialect (GOOGLESQL or POSTGRESQL). Default: GOOGLESQL.
optional string dialect = 6;
}
// Action that updates the schema of a Cloud Spanner database.
message UpdateCloudDatabaseDdlAction {
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
// Cloud database ID (not full path), e.g. "db0".
string database_id = 3;
// SDL statements to apply to the database.
repeated string sdl_statement = 4;
// Op ID can be used to track progress of the update. If set, it must be
// unique per database. If not set, Cloud Spanner will generate operation ID
// automatically.
string operation_id = 5;
}
// Action that updates a Cloud Spanner database.
message UpdateCloudDatabaseAction {
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
// Cloud database name (not full path), e.g. "db0".
string database_name = 3;
// Updated value of enable_drop_protection, this is the only field that has
// supported to be updated.
bool enable_drop_protection = 4;
}
// Action that drops a Cloud Spanner database.
message DropCloudDatabaseAction {
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 1;
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 2;
// Cloud database ID (not full path), e.g. "db0".
string database_id = 3;
}
// Action that lists Cloud Spanner databases.
message ListCloudDatabasesAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path) to list databases from, e.g. "test-instance".
string instance_id = 2;
// Number of databases to be returned in the response. If 0 or
// less, defaults to the server's maximum allowed page size.
int32 page_size = 3;
// If non-empty, "page_token" should contain a next_page_token
// from a previous ListDatabasesResponse to the same "parent"
// and with the same "filter".
string page_token = 4;
}
// Action that lists Cloud Spanner databases.
message ListCloudInstancesAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// A filter expression that filters what operations are returned in the
// response.
// The expression must specify the field name, a comparison operator,
// and the value that you want to use for filtering.
// Refer spanner_instance_admin.proto.ListInstancesRequest for
// detail.
optional string filter = 2;
// Number of instances to be returned in the response. If 0 or
// less, defaults to the server's maximum allowed page size.
optional int32 page_size = 3;
// If non-empty, "page_token" should contain a next_page_token
// from a previous ListInstancesResponse to the same "parent"
// and with the same "filter".
optional string page_token = 4;
}
// Action that retrieves a Cloud Spanner instance.
message GetCloudInstanceAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path) to retrieve the instance from,
// e.g. "test-instance".
string instance_id = 2;
}
// Action that lists Cloud Spanner database operations.
message ListCloudDatabaseOperationsAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path) to list database operations from,
// e.g. "test-instance".
string instance_id = 2;
// A filter expression that filters what operations are returned in the
// response.
// The expression must specify the field name, a comparison operator,
// and the value that you want to use for filtering.
// Refer spanner_database_admin.proto.ListDatabaseOperationsRequest for
// detail.
string filter = 3;
// Number of databases to be returned in the response. If 0 or
// less, defaults to the server's maximum allowed page size.
int32 page_size = 4;
// If non-empty, "page_token" should contain a next_page_token
// from a previous ListDatabaseOperationsResponse to the same "parent"
// and with the same "filter".
string page_token = 5;
}
// Action that restores a Cloud Spanner database from a backup.
message RestoreCloudDatabaseAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path) containing the backup, e.g. "backup-instance".
string backup_instance_id = 2;
// The id of the backup from which to restore, e.g. "test-backup".
string backup_id = 3;
// Cloud instance ID (not path) containing the database, e.g.
// "database-instance".
string database_instance_id = 4;
// The id of the database to create and restore to, e.g. "db0". Note that this
// database must not already exist.
string database_id = 5;
}
// Action that gets a Cloud Spanner database.
message GetCloudDatabaseAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 2;
// The id of the database to get, e.g. "db0".
string database_id = 3;
}
// Action that creates a Cloud Spanner database backup.
message CreateCloudBackupAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 2;
// The id of the backup to be created, e.g. "test-backup".
string backup_id = 3;
// The id of the database from which this backup was
// created, e.g. "db0". Note that this needs to be in the
// same instance as the backup.
string database_id = 4;
// Output only. The expiration time of the backup, which must be at least 6
// hours and at most 366 days from the time the request is received.
google.protobuf.Timestamp expire_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];
// The version time of the backup, which must be within the time range of
// [earliest_version_time, NOW], where earliest_version_time is retrieved by
// cloud spanner frontend API (See details: go/cs-pitr-lite-design).
optional google.protobuf.Timestamp version_time = 6;
}
// Action that copies a Cloud Spanner database backup.
message CopyCloudBackupAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 2;
// The id of the backup to be created, e.g. "test-backup".
string backup_id = 3;
// The fully qualified uri of the source backup from which this
// backup was copied. eg.
// "projects/<project_id>/instances/<instance_id>/backups/<backup_id>".
string source_backup = 4;
// Output only. The expiration time of the backup, which must be at least 6
// hours and at most 366 days from the time the request is received.
google.protobuf.Timestamp expire_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Action that gets a Cloud Spanner database backup.
message GetCloudBackupAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 2;
// The id of the backup to get, e.g. "test-backup".
string backup_id = 3;
}
// Action that updates a Cloud Spanner database backup.
message UpdateCloudBackupAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 2;
// The id of the backup to update, e.g. "test-backup".
string backup_id = 3;
// Output only. Updated value of expire_time, this is the only field
// that supported to be updated.
google.protobuf.Timestamp expire_time = 4
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Action that deletes a Cloud Spanner database backup.
message DeleteCloudBackupAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path), e.g. "test-instance".
string instance_id = 2;
// The id of the backup to delete, e.g. "test-backup".
string backup_id = 3;
}
// Action that lists Cloud Spanner database backups.
message ListCloudBackupsAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path) to list backups from, e.g. "test-instance".
string instance_id = 2;
// A filter expression that filters backups listed in the response.
// The expression must specify the field name, a comparison operator,
// and the value that you want to use for filtering.
// Refer backup.proto.ListBackupsRequest for detail.
string filter = 3;
// Number of backups to be returned in the response. If 0 or
// less, defaults to the server's maximum allowed page size.
int32 page_size = 4;
// If non-empty, "page_token" should contain a next_page_token
// from a previous ListBackupsResponse to the same "parent"
// and with the same "filter".
string page_token = 5;
}
// Action that lists Cloud Spanner database backup operations.
message ListCloudBackupOperationsAction {
// Cloud project ID, e.g. "spanner-cloud-systest".
string project_id = 1;
// Cloud instance ID (not path) to list backup operations from,
// e.g. "test-instance".
string instance_id = 2;