/
cloud_sql_resources.proto
2636 lines (2016 loc) · 85.8 KB
/
cloud_sql_resources.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.cloud.sql.v1beta4;
import "google/api/field_behavior.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb";
option java_multiple_files = true;
option java_outer_classname = "CloudSqlResourcesProto";
option java_package = "com.google.cloud.sql.v1beta4";
// An entry for an Access Control list.
message AclEntry {
// The allowlisted value for the access control list.
string value = 1;
// The time when this access control entry expires in
// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
// `2012-11-15T16:19:00.094Z`.
google.protobuf.Timestamp expiration_time = 2;
// Optional. A label to identify this entry.
string name = 3 [(google.api.field_behavior) = OPTIONAL];
// This is always `sql#aclEntry`.
string kind = 4;
}
// An Admin API warning message.
message ApiWarning {
enum SqlApiWarningCode {
// An unknown or unset warning type from Cloud SQL API.
SQL_API_WARNING_CODE_UNSPECIFIED = 0;
// Warning when one or more regions are not reachable. The returned result
// set may be incomplete.
REGION_UNREACHABLE = 1;
// Warning when user provided maxResults parameter exceeds the limit. The
// returned result set may be incomplete.
MAX_RESULTS_EXCEEDS_LIMIT = 2;
// Warning when user tries to create/update a user with credentials that
// have previously been compromised by a public data breach.
COMPROMISED_CREDENTIALS = 3;
// Warning when the operation succeeds but some non-critical workflow state
// failed.
INTERNAL_STATE_FAILURE = 4;
}
// Code to uniquely identify the warning type.
SqlApiWarningCode code = 1;
// The warning message.
string message = 2;
// The region name for REGION_UNREACHABLE warning.
string region = 3;
}
// We currently only support backup retention by specifying the number
// of backups we will retain.
message BackupRetentionSettings {
// The units that retained_backups specifies, we only support COUNT.
enum RetentionUnit {
// Backup retention unit is unspecified, will be treated as COUNT.
RETENTION_UNIT_UNSPECIFIED = 0;
// Retention will be by count, eg. "retain the most recent 7 backups".
COUNT = 1;
}
// The unit that 'retained_backups' represents.
RetentionUnit retention_unit = 1;
// Depending on the value of retention_unit, this is used to determine
// if a backup needs to be deleted. If retention_unit is 'COUNT', we will
// retain this many backups.
google.protobuf.Int32Value retained_backups = 2;
}
// Database instance backup configuration.
message BackupConfiguration {
// Start time for the daily backup configuration in UTC timezone in the 24
// hour format - `HH:MM`.
string start_time = 1;
// Whether this configuration is enabled.
google.protobuf.BoolValue enabled = 2;
// This is always `sql#backupConfiguration`.
string kind = 3;
// (MySQL only) Whether binary log is enabled. If backup configuration is
// disabled, binarylog must be disabled as well.
google.protobuf.BoolValue binary_log_enabled = 4;
// Reserved for future use.
google.protobuf.BoolValue replication_log_archiving_enabled = 5;
// Location of the backup
string location = 6;
// Whether point in time recovery is enabled.
google.protobuf.BoolValue point_in_time_recovery_enabled = 7;
// The number of days of transaction logs we retain for point in time
// restore, from 1-7.
google.protobuf.Int32Value transaction_log_retention_days = 9;
// Backup retention settings.
BackupRetentionSettings backup_retention_settings = 10;
}
// A BackupRun resource.
message BackupRun {
// This is always `sql#backupRun`.
string kind = 1;
// The status of this run.
SqlBackupRunStatus status = 2;
// The time the run was enqueued in UTC timezone in
// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
// `2012-11-15T16:19:00.094Z`.
google.protobuf.Timestamp enqueued_time = 3;
// The identifier for this backup run. Unique only for a specific Cloud SQL
// instance.
int64 id = 4;
// The time the backup operation actually started in UTC timezone in
// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
// `2012-11-15T16:19:00.094Z`.
google.protobuf.Timestamp start_time = 5;
// The time the backup operation completed in UTC timezone in
// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
// `2012-11-15T16:19:00.094Z`.
google.protobuf.Timestamp end_time = 6;
// Information about why the backup operation failed. This is only present if
// the run has the FAILED status.
OperationError error = 7;
// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
// This field defaults to "ON_DEMAND" and is ignored, when specified for
// insert requests.
SqlBackupRunType type = 8;
// The description of this run, only applicable to on-demand backups.
string description = 9;
// The start time of the backup window during which this the backup was
// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
// example `2012-11-15T16:19:00.094Z`.
google.protobuf.Timestamp window_start_time = 10;
// Name of the database instance.
string instance = 11;
// The URI of this resource.
string self_link = 12;
// Location of the backups.
string location = 13;
// Encryption configuration specific to a backup.
DiskEncryptionConfiguration disk_encryption_configuration = 16;
// Encryption status specific to a backup.
DiskEncryptionStatus disk_encryption_status = 17;
// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
SqlBackupKind backup_kind = 19;
// Backup time zone to prevent restores to an instance with
// a different time zone. Now relevant only for SQL Server.
string time_zone = 23;
}
// Backup run list results.
message BackupRunsListResponse {
// This is always `sql#backupRunsList`.
string kind = 1;
// A list of backup runs in reverse chronological order of the enqueued time.
repeated BackupRun items = 2;
// The continuation token, used to page through large result sets. Provide
// this value in a subsequent request to return the next page of results.
string next_page_token = 3;
}
// Binary log coordinates.
message BinLogCoordinates {
// Name of the binary log file for a Cloud SQL instance.
string bin_log_file_name = 1;
// Position (offset) within the binary log file.
int64 bin_log_position = 2;
// This is always `sql#binLogCoordinates`.
string kind = 3;
}
// Backup context.
message BackupContext {
// The identifier of the backup.
int64 backup_id = 1;
// This is always `sql#backupContext`.
string kind = 2;
}
// Database instance clone context.
message CloneContext {
// This is always `sql#cloneContext`.
string kind = 1;
// Reserved for future use.
int64 pitr_timestamp_ms = 2;
// Name of the Cloud SQL instance to be created as a clone.
string destination_instance_name = 3;
// Binary log coordinates, if specified, identify the position up to which the
// source instance is cloned. If not specified, the source instance is
// cloned up to the most recent binary log coordinates.
BinLogCoordinates bin_log_coordinates = 4;
// Timestamp, if specified, identifies the time to which the source instance
// is cloned.
google.protobuf.Timestamp point_in_time = 5;
// The name of the allocated ip range for the private ip Cloud SQL instance.
// For example: "google-managed-services-default". If set, the cloned instance
// ip will be created in the allocated range. The range name must comply with
// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
// must be 1-63 characters long and match the regular expression
// [a-z]([-a-z0-9]*[a-z0-9])?.
// Reserved for future use.
string allocated_ip_range = 6;
// (SQL Server only) Clone only the specified databases from the source
// instance. Clone all databases if empty.
repeated string database_names = 9;
// Optional. (Point-in-time recovery for PostgreSQL only) Clone to an instance
// in the specified zone. If no zone is specified, clone to the same zone as
// the source instance.
optional string preferred_zone = 10 [(google.api.field_behavior) = OPTIONAL];
}
// Represents a SQL database on the Cloud SQL instance.
message Database {
// This is always `sql#database`.
string kind = 1;
// The Cloud SQL charset value.
string charset = 2;
// The Cloud SQL collation value.
string collation = 3;
// This field is deprecated and will be removed from a future version of the
// API.
string etag = 4;
// The name of the database in the Cloud SQL instance. This does not include
// the project ID or instance name.
string name = 5;
// The name of the Cloud SQL instance. This does not include the project ID.
string instance = 6;
// The URI of this resource.
string self_link = 7;
// The project ID of the project containing the Cloud SQL database. The Google
// apps domain is prefixed if applicable.
string project = 8;
oneof database_details {
SqlServerDatabaseDetails sqlserver_database_details = 9;
}
}
// Represents a Sql Server database on the Cloud SQL instance.
message SqlServerDatabaseDetails {
// The version of SQL Server with which the database is to be made compatible
int32 compatibility_level = 1;
// The recovery model of a SQL Server database
string recovery_model = 2;
}
// Database flags for Cloud SQL instances.
message DatabaseFlags {
// The name of the flag. These flags are passed at instance startup, so
// include both server options and system variables. Flags are
// specified with underscores, not hyphens. For more information, see
// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
// in the Cloud SQL documentation.
string name = 1;
// The value of the flag. Boolean flags are set to `on` for true
// and `off` for false. This field must be omitted if the flag
// doesn't take a value.
string value = 2;
}
// Initial sync flags for certain Cloud SQL APIs.
// Currently used for the MySQL external server initial dump.
message SyncFlags {
// The name of the flag.
string name = 1;
// The value of the flag. This field must be omitted if the flag
// doesn't take a value.
string value = 2;
}
// Reference to another Cloud SQL instance.
message InstanceReference {
// The name of the Cloud SQL instance being referenced.
// This does not include the project ID.
string name = 1;
// The region of the Cloud SQL instance being referenced.
string region = 2;
// The project ID of the Cloud SQL instance being referenced.
// The default is the same project ID as the instance references it.
string project = 3;
}
// A Cloud SQL instance resource.
message DatabaseInstance {
// The current serving state of the database instance.
enum SqlInstanceState {
// The state of the instance is unknown.
SQL_INSTANCE_STATE_UNSPECIFIED = 0;
// The instance is running, or has been stopped by owner.
RUNNABLE = 1;
// The instance is not available, for example due to problems with billing.
SUSPENDED = 2;
// The instance is being deleted.
PENDING_DELETE = 3;
// The instance is being created.
PENDING_CREATE = 4;
// The instance is down for maintenance.
MAINTENANCE = 5;
// The creation of the instance failed or a fatal error occurred during
// maintenance.
FAILED = 6;
// Deprecated
ONLINE_MAINTENANCE = 7 [deprecated = true];
}
message SqlFailoverReplica {
// The name of the failover replica. If specified at instance creation, a
// failover replica is created for the instance. The name
// doesn't include the project ID.
string name = 1;
// The availability status of the failover replica. A false status indicates
// that the failover replica is out of sync. The primary instance can only
// failover to the failover replica when the status is true.
google.protobuf.BoolValue available = 2;
}
// Any scheduled maintenance for this instance.
message SqlScheduledMaintenance {
// The start time of any upcoming scheduled maintenance for this instance.
google.protobuf.Timestamp start_time = 1;
bool can_defer = 2 [deprecated = true];
// If the scheduled maintenance can be rescheduled.
bool can_reschedule = 3;
// Maintenance cannot be rescheduled to start beyond this deadline.
optional google.protobuf.Timestamp schedule_deadline_time = 4;
}
// This message wraps up the information written by out-of-disk detection job.
message SqlOutOfDiskReport {
// This enum lists all possible states regarding out-of-disk issues.
enum SqlOutOfDiskState {
// Unspecified state
SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0;
// The instance has plenty space on data disk
NORMAL = 1;
// Data disk is almost used up. It is shutdown to prevent data
// corruption.
SOFT_SHUTDOWN = 2;
}
// This field represents the state generated by the proactive database
// wellness job for OutOfDisk issues.
// * Writers:
// * the proactive database wellness job for OOD.
// * Readers:
// * the proactive database wellness job
optional SqlOutOfDiskState sql_out_of_disk_state = 1;
// The minimum recommended increase size in GigaBytes
// This field is consumed by the frontend
// * Writers:
// * the proactive database wellness job for OOD.
// * Readers:
optional int32 sql_min_recommended_increase_size_gb = 2;
}
// The SQL network architecture for the instance.
enum SqlNetworkArchitecture {
SQL_NETWORK_ARCHITECTURE_UNSPECIFIED = 0;
// The instance uses the new network architecture.
NEW_NETWORK_ARCHITECTURE = 1;
// The instance uses the old network architecture.
OLD_NETWORK_ARCHITECTURE = 2;
}
// This is always `sql#instance`.
string kind = 1;
// The current serving state of the Cloud SQL instance.
SqlInstanceState state = 2;
// The database engine type and version. The `databaseVersion` field cannot
// be changed after instance creation.
SqlDatabaseVersion database_version = 3;
// The user settings.
Settings settings = 4;
// This field is deprecated and will be removed from a future version of the
// API. Use the `settings.settingsVersion` field instead.
string etag = 5;
// The name and status of the failover replica.
SqlFailoverReplica failover_replica = 6;
// The name of the instance which will act as primary in the replication
// setup.
string master_instance_name = 7;
// The replicas of the instance.
repeated string replica_names = 8;
// The maximum disk size of the instance in bytes.
google.protobuf.Int64Value max_disk_size = 9 [deprecated = true];
// The current disk usage of the instance in bytes. This property has been
// deprecated. Use the
// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
// Monitoring API instead. Please see [this
// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
// for details.
google.protobuf.Int64Value current_disk_size = 10 [deprecated = true];
// The assigned IP addresses for the instance.
repeated IpMapping ip_addresses = 11;
// SSL configuration.
SslCert server_ca_cert = 12;
// The instance type.
SqlInstanceType instance_type = 13;
// The project ID of the project containing the Cloud SQL instance. The Google
// apps domain is prefixed if applicable.
string project = 14;
// The IPv6 address assigned to the instance.
// (Deprecated) This property was applicable only
// to First Generation instances.
string ipv6_address = 15 [deprecated = true];
// The service account email address assigned to the instance. \This
// property is read-only.
string service_account_email_address = 16;
// Configuration specific to on-premises instances.
OnPremisesConfiguration on_premises_configuration = 17;
// Configuration specific to failover replicas and read replicas.
ReplicaConfiguration replica_configuration = 18;
// The backend type.
// `SECOND_GEN`: Cloud SQL database instance.
// `EXTERNAL`: A database server that is not managed by Google.
//
// This property is read-only; use the `tier` property in the `settings`
// object to determine the database type.
SqlBackendType backend_type = 19;
// The URI of this resource.
string self_link = 20;
// If the instance state is SUSPENDED, the reason for the suspension.
repeated SqlSuspensionReason suspension_reason = 21;
// Connection name of the Cloud SQL instance used in connection strings.
string connection_name = 22;
// Name of the Cloud SQL instance. This does not include the project ID.
string name = 23;
// The geographical region of the Cloud SQL instance.
//
// It can be one of the
// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
// where Cloud SQL operates:
//
// For example, `asia-east1`, `europe-west1`, and `us-central1`.
// The default value is `us-central1`.
string region = 24;
// The Compute Engine zone that the instance is currently serving from. This
// value could be different from the zone that was specified when the instance
// was created if the instance has failed over to its secondary zone. WARNING:
// Changing this might restart the instance.
string gce_zone = 25;
// The Compute Engine zone that the failover instance is currently serving
// from for a regional instance. This value could be different
// from the zone that was specified when the instance
// was created if the instance has failed over to its secondary/failover zone.
string secondary_gce_zone = 34;
// Disk encryption configuration specific to an instance.
DiskEncryptionConfiguration disk_encryption_configuration = 26;
// Disk encryption status specific to an instance.
DiskEncryptionStatus disk_encryption_status = 27;
// Initial root password. Use only on creation. You must set root passwords
// before you can connect to PostgreSQL instances.
string root_password = 29;
// The start time of any upcoming scheduled maintenance for this instance.
SqlScheduledMaintenance scheduled_maintenance = 30;
// The status indicating if instance satisfiesPzs.
// Reserved for future use.
google.protobuf.BoolValue satisfies_pzs = 35;
// Output only. Stores the current database version running on the instance
// including minor version such as `MYSQL_8_0_18`.
string database_installed_version = 40
[(google.api.field_behavior) = OUTPUT_ONLY];
// This field represents the report generated by the proactive database
// wellness job for OutOfDisk issues.
// * Writers:
// * the proactive database wellness job for OOD.
// * Readers:
// * the proactive database wellness job
optional SqlOutOfDiskReport out_of_disk_report = 38;
// Output only. The time when the instance was created in
// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
// `2012-11-15T16:19:00.094Z`.
google.protobuf.Timestamp create_time = 39
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. List all maintenance versions applicable on the instance
repeated string available_maintenance_versions = 41
[(google.api.field_behavior) = OUTPUT_ONLY];
// The current software version on the instance.
string maintenance_version = 42;
// The SQL network architecture for the instance.
optional SqlNetworkArchitecture sql_network_architecture = 47;
// Output only. The link to service attachment of PSC instance.
optional string psc_service_attachment_link = 48
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The dns name of the instance.
optional string dns_name = 49 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. DEPRECATED: please use write_endpoint instead.
optional string primary_dns_name = 51
[deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The dns name of the primary instance in a replication group.
optional string write_endpoint = 52
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Database list response.
message DatabasesListResponse {
// This is always `sql#databasesList`.
string kind = 1;
// List of database resources in the instance.
repeated Database items = 2;
}
// Read-replica configuration for connecting to the on-premises primary
// instance.
message DemoteMasterConfiguration {
// This is always `sql#demoteMasterConfiguration`.
string kind = 1;
// MySQL specific configuration when replicating from a MySQL on-premises
// primary instance. Replication configuration information such as the
// username, password, certificates, and keys are not stored in the instance
// metadata. The configuration information is used only to set up the
// replication connection and is stored by MySQL in a file named
// `master.info` in the data directory.
DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2;
}
// Database instance demote primary instance context.
message DemoteMasterContext {
// This is always `sql#demoteMasterContext`.
string kind = 1;
// Verify the GTID consistency for demote operation. Default value:
// `True`. Setting this flag to `false` enables you to bypass the GTID
// consistency check between on-premises primary instance and Cloud SQL
// instance during the demotion operation but also exposes you to the risk of
// future replication failures. Change the value only if you know the reason
// for the GTID divergence and are confident that doing so will not cause any
// replication issues.
google.protobuf.BoolValue verify_gtid_consistency = 2;
// The name of the instance which will act as on-premises primary instance
// in the replication setup.
string master_instance_name = 3;
// Configuration specific to read-replicas replicating from the on-premises
// primary instance.
DemoteMasterConfiguration replica_configuration = 4;
// Flag to skip replication setup on the instance.
bool skip_replication_setup = 5;
}
// Read-replica configuration specific to MySQL databases.
message DemoteMasterMySqlReplicaConfiguration {
// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
string kind = 1;
// The username for the replication connection.
string username = 2;
// The password for the replication connection.
string password = 3;
// PEM representation of the replica's private key. The corresponsing public
// key is encoded in the client's certificate. The format of the replica's
// private key can be either PKCS #1 or PKCS #8.
string client_key = 4;
// PEM representation of the replica's x509 certificate.
string client_certificate = 5;
// PEM representation of the trusted CA's x509 certificate.
string ca_certificate = 6;
}
// This context is used to demote an existing standalone instance to be
// a Cloud SQL read replica for an external database server.
message DemoteContext {
// This is always `sql#demoteContext`.
string kind = 1;
// Required. The name of the instance which acts as an on-premises primary
// instance in the replication setup.
string source_representative_instance_name = 2
[(google.api.field_behavior) = REQUIRED];
}
enum SqlFileType {
// Unknown file type.
SQL_FILE_TYPE_UNSPECIFIED = 0;
// File containing SQL statements.
SQL = 1;
// File in CSV format.
CSV = 2;
BAK = 4;
}
// Database instance export context.
message ExportContext {
message SqlCsvExportOptions {
// The select query used to extract the data.
string select_query = 1;
// Specifies the character that should appear before a data character that
// needs to be escaped.
string escape_character = 2;
// Specifies the quoting character to be used when a data value is quoted.
string quote_character = 3;
// Specifies the character that separates columns within each row (line) of
// the file.
string fields_terminated_by = 4;
// This is used to separate lines. If a line does not contain all fields,
// the rest of the columns are set to their default values.
string lines_terminated_by = 6;
}
message SqlExportOptions {
// Options for exporting from MySQL.
message MysqlExportOptions {
// Option to include SQL statement required to set up replication. If set
// to `1`, the dump file includes a CHANGE MASTER TO statement with the
// binary log coordinates, and --set-gtid-purged is set to ON. If set to
// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
// has no effect. If set to any value other than `1`, --set-gtid-purged
// is set to OFF.
google.protobuf.Int32Value master_data = 1;
}
// Tables to export, or that were exported, from the specified database. If
// you specify tables, specify one and only one database. For PostgreSQL
// instances, you can specify only one table.
repeated string tables = 1;
// Export only schemas.
google.protobuf.BoolValue schema_only = 2;
MysqlExportOptions mysql_export_options = 3;
// Optional. The number of threads to use for parallel export.
google.protobuf.Int32Value threads = 4
[(google.api.field_behavior) = OPTIONAL];
// Optional. Whether or not the export should be parallel.
google.protobuf.BoolValue parallel = 5
[(google.api.field_behavior) = OPTIONAL];
}
// Options for exporting BAK files (SQL Server-only)
message SqlBakExportOptions {
// Whether or not the export should be striped.
google.protobuf.BoolValue striped = 1;
// Option for specifying how many stripes to use for the export.
// If blank, and the value of the striped field is true,
// the number of stripes is automatically chosen.
google.protobuf.Int32Value stripe_count = 2;
// Type of this bak file will be export, FULL or DIFF, SQL Server only
BakType bak_type = 4;
// Deprecated: copy_only is deprecated. Use differential_base instead
google.protobuf.BoolValue copy_only = 5 [deprecated = true];
// Whether or not the backup can be used as a differential base
// copy_only backup can not be served as differential base
google.protobuf.BoolValue differential_base = 6;
}
// The path to the file in Google Cloud Storage where the export will be
// stored. The URI is in the form `gs://bucketName/fileName`. If the file
// already exists, the request succeeds, but the operation fails. If
// `fileType` is `SQL` and the filename ends with .gz,
// the contents are compressed.
string uri = 1;
// Databases to be exported. <br /> `MySQL instances:` If
// `fileType` is `SQL` and no database is specified, all
// databases are exported, except for the `mysql` system database.
// If `fileType` is `CSV`, you can specify one database,
// either by using this property or by using the
// `csvExportOptions.selectQuery` property, which takes precedence
// over this property. <br /> `PostgreSQL instances:` You must specify
// one database to be exported. If `fileType` is `CSV`,
// this database must match the one specified in the
// `csvExportOptions.selectQuery` property. <br /> `SQL Server
// instances:` You must specify one database to be exported, and the
// `fileType` must be `BAK`.
repeated string databases = 2;
// This is always `sql#exportContext`.
string kind = 3;
// Options for exporting data as SQL statements.
SqlExportOptions sql_export_options = 4;
// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
// instances only.
SqlCsvExportOptions csv_export_options = 5;
// The file type for the specified uri.
SqlFileType file_type = 6;
// Option for export offload.
google.protobuf.BoolValue offload = 8;
// Options for exporting data as BAK files.
SqlBakExportOptions bak_export_options = 9;
}
// Database instance failover context.
message FailoverContext {
// The current settings version of this instance. Request will be rejected if
// this version doesn't match the current settings version.
int64 settings_version = 1;
// This is always `sql#failoverContext`.
string kind = 2;
}
// A flag resource.
message Flag {
// This is the name of the flag. Flag names always use underscores, not
// hyphens, for example: `max_allowed_packet`
string name = 1;
// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
// `INTEGER` or `NONE`. `NONE` is used for flags which do not take a
// value, such as `skip_grant_tables`.
SqlFlagType type = 2;
// The database version this flag applies to. Can be
// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
// `SQLSERVER_2019_WEB`.
// See [the complete
// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
repeated SqlDatabaseVersion applies_to = 3;
// For `STRING` flags, a list of strings that the value can be set to.
repeated string allowed_string_values = 4;
// For `INTEGER` flags, the minimum allowed value.
google.protobuf.Int64Value min_value = 5;
// For `INTEGER` flags, the maximum allowed value.
google.protobuf.Int64Value max_value = 6;
// Indicates whether changing this flag will trigger a database restart. Only
// applicable to Second Generation instances.
google.protobuf.BoolValue requires_restart = 7;
// This is always `sql#flag`.
string kind = 8;
// Whether or not the flag is considered in beta.
google.protobuf.BoolValue in_beta = 9;
// Use this field if only certain integers are accepted. Can be combined
// with min_value and max_value to add additional values.
repeated int64 allowed_int_values = 10;
}
// Flags list response.
message FlagsListResponse {
// This is always `sql#flagsList`.
string kind = 1;
// List of flags.
repeated Flag items = 2;
}
// Database instance import context.
message ImportContext {
message SqlCsvImportOptions {
// The table to which CSV data is imported.
string table = 1;
// The columns to which CSV data is imported. If not specified, all columns
// of the database table are loaded with CSV data.
repeated string columns = 2;
// Specifies the character that should appear before a data character that
// needs to be escaped.
string escape_character = 4;
// Specifies the quoting character to be used when a data value is quoted.
string quote_character = 5;
// Specifies the character that separates columns within each row (line) of
// the file.
string fields_terminated_by = 6;
// This is used to separate lines. If a line does not contain all fields,
// the rest of the columns are set to their default values.
string lines_terminated_by = 8;
}
message SqlBakImportOptions {
message EncryptionOptions {
// Path to the Certificate (.cer) in Cloud Storage, in the form
// `gs://bucketName/fileName`. The instance must have write permissions
// to the bucket and read access to the file.
string cert_path = 1;
// Path to the Certificate Private Key (.pvk) in Cloud Storage, in the
// form `gs://bucketName/fileName`. The instance must have write
// permissions to the bucket and read access to the file.
string pvk_path = 2;
// Password that encrypts the private key
string pvk_password = 3;
}
EncryptionOptions encryption_options = 1;
// Whether or not the backup set being restored is striped.
// Applies only to Cloud SQL for SQL Server.
google.protobuf.BoolValue striped = 2;
// Whether or not the backup importing will restore database
// with NORECOVERY option
// Applies only to Cloud SQL for SQL Server.
google.protobuf.BoolValue no_recovery = 4;
// Whether or not the backup importing request will just bring database
// online without downloading Bak content only one of "no_recovery" and
// "recovery_only" can be true otherwise error will return. Applies only to
// Cloud SQL for SQL Server.
google.protobuf.BoolValue recovery_only = 5;
// Type of the bak content, FULL or DIFF.
BakType bak_type = 6;
// Optional. The timestamp when the import should stop. This timestamp is in
// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
// keyword and applies to Cloud SQL for SQL Server only.
google.protobuf.Timestamp stop_at = 7
[(google.api.field_behavior) = OPTIONAL];
// Optional. The marked transaction where the import should stop. This field
// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
// Server only.
string stop_at_mark = 8 [(google.api.field_behavior) = OPTIONAL];
}
// Path to the import file in Cloud Storage, in the form
// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
// when `fileType` is `SQL`. The instance must have
// write permissions to the bucket and read access to the file.
string uri = 1;
// The target database for the import. If `fileType` is `SQL`, this field
// is required only if the import file does not specify a database, and is
// overridden by any database specification in the import file. If
// `fileType` is `CSV`, one database must be specified.
string database = 2;
// This is always `sql#importContext`.
string kind = 3;
// The file type for the specified uri.
// * `SQL`: The file contains SQL statements.
// * `CSV`: The file contains CSV data.
// * `BAK`: The file contains backup data for a SQL Server instance.
SqlFileType file_type = 4;
// Options for importing data as CSV.
SqlCsvImportOptions csv_import_options = 5;