-
Notifications
You must be signed in to change notification settings - Fork 666
Expand file tree
/
Copy pathcloud_sql_resources.proto
More file actions
2349 lines (1821 loc) · 81.5 KB
/
cloud_sql_resources.proto
File metadata and controls
2349 lines (1821 loc) · 81.5 KB
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 2026 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.v1;
import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb";
option java_multiple_files = true;
option java_outer_classname = "CloudSqlResourcesProto";
option java_package = "com.google.cloud.sql.v1";
// 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 {
// This value contains the storage location of the transactional logs
// used to perform point-in-time recovery (PITR) for the database.
enum TransactionalLogStorageState {
// Unspecified.
TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED = 0;
// The transaction logs used for PITR for the instance are stored
// on a data disk.
DISK = 1;
// The transaction logs used for PITR for the instance are switching from
// being stored on a data disk to being stored in Cloud Storage.
// Only applicable to MySQL.
SWITCHING_TO_CLOUD_STORAGE = 2;
// The transaction logs used for PITR for the instance are now stored
// in Cloud Storage. Previously, they were stored on a data disk.
// Only applicable to MySQL.
SWITCHED_TO_CLOUD_STORAGE = 3;
// The transaction logs used for PITR for the instance are stored in
// Cloud Storage. Only applicable to MySQL and PostgreSQL.
CLOUD_STORAGE = 4;
}
// Backup tier that manages the backups for the instance.
enum BackupTier {
// Unspecified.
BACKUP_TIER_UNSPECIFIED = 0;
// Instance is managed by Cloud SQL.
STANDARD = 1;
// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
ADVANCED = 2 [deprecated = true];
// Instance is managed by Google Cloud Backup and DR Service.
ENHANCED = 3;
}
// 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;
// Backup retention settings.
BackupRetentionSettings backup_retention_settings = 8;
// 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;
// Output only. This value contains the storage location of transactional logs
// used to perform point-in-time recovery (PITR) for the database.
optional TransactionalLogStorageState transactional_log_storage_state = 10
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Backup tier that manages the backups for the instance.
optional BackupTier backup_tier = 11
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Perform disk shrink context.
message PerformDiskShrinkContext {
// The target disk shrink size in GigaBytes.
int64 target_size_gb = 1;
}
// Structured PreCheckResponse containing message, type, and required
// actions.
message PreCheckResponse {
// The type of message which can be an info, a warning, or an error that
// requires user intervention.
enum MessageType {
// Default unspecified value to prevent unintended behavior changes.
MESSAGE_TYPE_UNSPECIFIED = 0;
// General informational messages that don't require action.
INFO = 1;
// Warnings that might impact the upgrade but don't block it.
WARNING = 2;
// Errors that a user must resolve before proceeding with the upgrade.
ERROR = 3;
}
// The message to be displayed to the user.
optional string message = 2;
// The type of message whether it is an info, warning, or error.
optional MessageType message_type = 3;
// The actions that the user needs to take. Use repeated for multiple
// actions.
repeated string actions_required = 4;
}
// Pre-check major version upgrade context.
message PreCheckMajorVersionUpgradeContext {
// Required. The target database version to upgrade to.
SqlDatabaseVersion target_database_version = 1
[(google.api.field_behavior) = REQUIRED];
// Output only. The responses from the precheck operation.
repeated PreCheckResponse pre_check_response = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
string kind = 3 [(google.api.field_behavior) = OPTIONAL];
}
// Backup context.
message BackupContext {
// The identifier of the backup.
int64 backup_id = 1;
// This is always `sql#backupContext`.
string kind = 2;
// The name of the backup.
// Format: projects/{project}/backups/{backup}
string name = 3;
}
// 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;
}
// MySQL-specific external server sync settings.
message MySqlSyncConfig {
// Flags to use for the initial dump.
repeated SyncFlags initial_sync_flags = 1;
}
// 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;
}
// 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;
}
// 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 corresponding 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;
}
enum SqlFileType {
// Unknown file type.
SQL_FILE_TYPE_UNSPECIFIED = 0;
// File containing SQL statements.
SQL = 1;
// File in CSV format.
CSV = 2;
BAK = 4;
// TDE certificate.
TDE = 8;
}
// 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;
}
// Options for exporting from a Cloud SQL for PostgreSQL instance.
message PostgresExportOptions {
// Optional. Use this option to include DROP <code><object></code>
// SQL statements. Use these statements to delete database objects before
// running the import operation.
google.protobuf.BoolValue clean = 1
[(google.api.field_behavior) = OPTIONAL];
// Optional. Option to include an IF EXISTS SQL statement with each DROP
// statement produced by clean.
google.protobuf.BoolValue if_exists = 2
[(google.api.field_behavior) = OPTIONAL];
}
// 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];
// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
PostgresExportOptions postgres_export_options = 6
[(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;
// Optional. The begin timestamp when transaction log will be included in
// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
// available logs from the beginning of retention period will be included.
// Only applied to Cloud SQL for SQL Server.
google.protobuf.Timestamp export_log_start_time = 7
[(google.api.field_behavior) = OPTIONAL];
// Optional. The end timestamp when transaction log will be included in the
// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
// available logs until current time will be included. Only applied to Cloud
// SQL for SQL Server.
google.protobuf.Timestamp export_log_end_time = 8
[(google.api.field_behavior) = OPTIONAL];
}
message SqlTdeExportOptions {
// Required. Path to the TDE certificate public key
// in the form gs://bucketName/fileName.
// The instance must have write access to the bucket.
// Applicable only for SQL Server instances.
string certificate_path = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Path to the TDE certificate private key
// in the form gs://bucketName/fileName.
// The instance must have write access to the location.
// Applicable only for SQL Server instances.
string private_key_path = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Password that encrypts the private key.
string private_key_password = 3 [(google.api.field_behavior) = REQUIRED];
// Required. Certificate name.
// Applicable only for SQL Server instances.
string name = 5 [(google.api.field_behavior) = REQUIRED];
}
// 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:` If you don't specify a
// database by name, all user databases in the instance are exported.
// This excludes system databases and Cloud SQL databases used to manage
// internal operations. Exporting all user databases is only available for
// directory-formatted parallel export. 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;
// Whether to perform a serverless export.
google.protobuf.BoolValue offload = 8;
// Options for exporting data as BAK files.
SqlBakExportOptions bak_export_options = 9;
// Optional. Export parameters specific to SQL Server TDE certificates
SqlTdeExportOptions tde_export_options = 10
[(google.api.field_behavior) = OPTIONAL];
}
// Database instance import context.
message ImportContext {
message SqlImportOptions {
message PostgresImportOptions {
// Optional. The --clean flag for the pg_restore utility. This flag
// applies only if you enabled Cloud SQL to import files in parallel.
google.protobuf.BoolValue clean = 1
[(google.api.field_behavior) = OPTIONAL];
// Optional. The --if-exists flag for the pg_restore utility. This flag
// applies only if you enabled Cloud SQL to import files in parallel.
google.protobuf.BoolValue if_exists = 2
[(google.api.field_behavior) = OPTIONAL];
}
// Optional. The number of threads to use for parallel import.
google.protobuf.Int32Value threads = 1
[(google.api.field_behavior) = OPTIONAL];
// Optional. Whether or not the import should be parallel.
google.protobuf.BoolValue parallel = 2
[(google.api.field_behavior) = OPTIONAL];
// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
PostgresImportOptions postgres_import_options = 3
[(google.api.field_behavior) = OPTIONAL];
}
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;
// Optional. Whether the imported file remains encrypted.
google.protobuf.BoolValue keep_encrypted = 5
[(google.api.field_behavior) = OPTIONAL];
}
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];
}
message SqlTdeImportOptions {
// Required. Path to the TDE certificate public key
// in the form gs://bucketName/fileName.
// The instance must have read access to the file.
// Applicable only for SQL Server instances.
string certificate_path = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Path to the TDE certificate private key
// in the form gs://bucketName/fileName.
// The instance must have read access to the file.
// Applicable only for SQL Server instances.
string private_key_path = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Password that encrypts the private key.
string private_key_password = 3 [(google.api.field_behavior) = REQUIRED];
// Required. Certificate name.
// Applicable only for SQL Server instances.
string name = 5 [(google.api.field_behavior) = REQUIRED];
}
// 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. For entire
// instance parallel import operations, the database is overridden by the
// database name stored in subdirectory name. 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.
SqlFileType file_type = 4;
// Options for importing data as CSV.
SqlCsvImportOptions csv_import_options = 5;
// The PostgreSQL user for this import operation. PostgreSQL instances only.
string import_user = 6;
// Import parameters specific to SQL Server .BAK files
SqlBakImportOptions bak_import_options = 7;
// Optional. Options for importing data from SQL statements.
SqlImportOptions sql_import_options = 8
[(google.api.field_behavior) = OPTIONAL];
// Optional. Import parameters specific to SQL Server TDE certificates
SqlTdeImportOptions tde_import_options = 9
[(google.api.field_behavior) = OPTIONAL];
}
enum BakType {
// Default type.
BAK_TYPE_UNSPECIFIED = 0;
// Full backup.
FULL = 1;
// Differential backup.
DIFF = 2;
// Transaction Log backup
TLOG = 3;
}
// IP Management configuration.
message IpConfiguration {
// The SSL options for database connections.
enum SslMode {
// The SSL mode is unknown.
SSL_MODE_UNSPECIFIED = 0;
// Allow non-SSL/non-TLS and SSL/TLS connections.
// For SSL connections to MySQL and PostgreSQL, the client certificate
// isn't verified.
//
// When this value is used, the legacy `require_ssl` flag must be false or
// cleared to avoid a conflict between the values of the two flags.
ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1;
// Only allow connections encrypted with SSL/TLS.
// For SSL connections to MySQL and PostgreSQL, the client certificate
// isn't verified.
//
// When this value is used, the legacy `require_ssl` flag must be false or
// cleared to avoid a conflict between the values of the two flags.
ENCRYPTED_ONLY = 2;
// Only allow connections encrypted with SSL/TLS and with valid
// client certificates.
//
// When this value is used, the legacy `require_ssl` flag must be true or
// cleared to avoid the conflict between values of two flags.
// PostgreSQL clients or users that connect using IAM database
// authentication must use either the
// [Cloud SQL Auth
// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
// [Cloud SQL
// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
// to enforce client identity verification.
//
// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3;
}
// Various Certificate Authority (CA) modes for certificate signing.
enum CaMode {
// CA mode is unspecified. It is effectively the same as
// `GOOGLE_MANAGED_INTERNAL_CA`.
CA_MODE_UNSPECIFIED = 0;
// Google-managed self-signed internal CA.
GOOGLE_MANAGED_INTERNAL_CA = 1;
// Google-managed regional CA part of root CA hierarchy hosted on Google
// Cloud's Certificate Authority Service (CAS).
GOOGLE_MANAGED_CAS_CA = 2;
// Customer-managed CA hosted on Google Cloud's Certificate Authority
// Service (CAS).
CUSTOMER_MANAGED_CAS_CA = 3;
}
// Settings for automatic server certificate rotation.
enum ServerCertificateRotationMode {
// Unspecified: no automatic server certificate rotation.
SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED = 0;
// No automatic server certificate rotation. The user must [manage server
// certificate
// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
// on their side.
NO_AUTOMATIC_ROTATION = 1;
// Automatic server certificate rotation during Cloud SQL scheduled
// maintenance or self-service maintenance updates. Requires
// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
// `CUSTOMER_MANAGED_CAS_CA`.
AUTOMATIC_ROTATION_DURING_MAINTENANCE = 2;
}
// Whether the instance is assigned a public IP address or not.
google.protobuf.BoolValue ipv4_enabled = 1;
// The resource link for the VPC network from which the Cloud SQL instance is
// accessible for private IP. For example,
// `/projects/myProject/global/networks/default`. This setting can
// be updated, but it cannot be removed after it is set.
string private_network = 2;
// Use `ssl_mode` instead.
//
// Whether SSL/TLS connections over IP are enforced.
// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
// For SSL/TLS connections, the client certificate won't be verified. If
// set to true, then only allow connections encrypted with SSL/TLS and with
// valid client certificates. If you want to enforce SSL/TLS without enforcing
// the requirement for valid client certificates, then use the `ssl_mode` flag
// instead of the `require_ssl` flag.
google.protobuf.BoolValue require_ssl = 3;
// The list of external networks that are allowed to connect to the instance
// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
// example: `157.197.200.0/24`).
repeated AclEntry authorized_networks = 4;
// The name of the allocated ip range for the private ip Cloud SQL instance.
// For example: "google-managed-services-default". If set, the 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])?.`
string allocated_ip_range = 6;
// Controls connectivity to private IP instances from Google services,
// such as BigQuery.
google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7;
// Specify how SSL/TLS is enforced in database connections. If you must use
// the `require_ssl` flag for backward compatibility, then only the following
// value pairs are valid:
//
// For PostgreSQL and MySQL:
//
// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
//
// For SQL Server:
//
// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
//
// The value of `ssl_mode` has priority over the value of `require_ssl`.
//
// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
// connections, while `require_ssl=false` means accept both non-SSL
// and SSL connections. In this case, MySQL and PostgreSQL databases respect
// `ssl_mode` and accepts only SSL connections.
SslMode ssl_mode = 8;
// PSC settings for this instance.
optional PscConfig psc_config = 9;
// Specify what type of CA is used for the server certificate.
optional CaMode server_ca_mode = 10;
// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
repeated string custom_subject_alternative_names = 11
[(google.api.field_behavior) = OPTIONAL];
// Optional. The resource name of the server CA pool for an instance with
// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
optional string server_ca_pool = 12 [(google.api.field_behavior) = OPTIONAL];
// Optional. Controls the automatic server certificate rotation feature. This
// feature is disabled by default. When enabled, the server certificate will
// be automatically rotated during Cloud SQL scheduled maintenance or
// self-service maintenance updates up to six months before it expires. This
// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
// or CUSTOMER_MANAGED_CAS_CA.
optional ServerCertificateRotationMode server_certificate_rotation_mode = 16
[(google.api.field_behavior) = OPTIONAL];
}
// PSC settings for a Cloud SQL instance.
message PscConfig {
// Whether PSC connectivity is enabled for this instance.
optional bool psc_enabled = 1;
// Optional. The list of consumer projects that are allow-listed for PSC
// connections to this instance. This instance can be connected to with PSC
// from any network in these projects.
//
// Each consumer project in this list may be represented by a project number
// (numeric) or by a project id (alphanumeric).
repeated string allowed_consumer_projects = 2
[(google.api.field_behavior) = OPTIONAL];
// Optional. The list of settings for requested Private Service Connect
// consumer endpoints that can be used to connect to this Cloud SQL instance.
repeated PscAutoConnectionConfig psc_auto_connections = 3
[(google.api.field_behavior) = OPTIONAL];
// Optional. The network attachment of the consumer network that the
// Private Service Connect enabled Cloud SQL instance is
// authorized to connect via PSC interface.
// format: projects/PROJECT/regions/REGION/networkAttachments/ID
string network_attachment_uri = 4 [(google.api.field_behavior) = OPTIONAL];
}
// Settings for an automatically-setup Private Service Connect consumer endpoint
// that is used to connect to a Cloud SQL instance.
message PscAutoConnectionConfig {
// Optional. This is the project ID of consumer service project of this
// consumer endpoint.
//
// Optional. This is only applicable if consumer_network is a shared vpc
// network.
string consumer_project = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. The consumer network of this consumer endpoint. This must be a
// resource path that includes both the host project and the network name.
//
// For example, `projects/project1/global/networks/network1`.
//
// The consumer host project of this network might be different from the
// consumer service project.
string consumer_network = 2 [(google.api.field_behavior) = OPTIONAL];
// The IP address of the consumer endpoint.
optional string ip_address = 3
[(google.api.field_info).format = IPV4_OR_IPV6];
// The connection status of the consumer endpoint.
optional string status = 4;
// The connection policy status of the consumer network.
optional string consumer_network_status = 5;
}
// Preferred location. This specifies where a Cloud SQL instance is located.
// Note that if the preferred location is not available, the instance will be
// located as close as possible within the region. Only one location may be
// specified.
message LocationPreference {
// The App Engine application to follow, it must be in the same region as the
// Cloud SQL instance. WARNING: Changing this might restart the instance.
string follow_gae_application = 1 [deprecated = true];
// The preferred Compute Engine zone (for example: us-central1-a,
// us-central1-b, etc.). WARNING: Changing this might restart the instance.
string zone = 2;
// The preferred Compute Engine zone for the secondary/failover
// (for example: us-central1-a, us-central1-b, etc.).
// To disable this field, set it to 'no_secondary_zone'.
string secondary_zone = 4;
// This is always `sql#locationPreference`.
string kind = 3;
}
// Maintenance window. This specifies when a Cloud SQL instance is
// restarted for system maintenance purposes.
message MaintenanceWindow {
// Hour of day - 0 to 23. Specify in the UTC time zone.
google.protobuf.Int32Value hour = 1;
// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
// Returned in output as an integer, 1 to 7, where `1` equals Monday.
google.protobuf.Int32Value day = 2;
// Maintenance timing settings: `canary`, `stable`, or `week5`.
// For more information, see [About maintenance on Cloud SQL
// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
SqlUpdateTrack update_track = 3;