xref: /aosp_15_r20/external/googleapis/google/cloud/sql/v1/cloud_sql_resources.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.sql.v1;
18
19import "google/api/field_behavior.proto";
20import "google/protobuf/duration.proto";
21import "google/protobuf/timestamp.proto";
22import "google/protobuf/wrappers.proto";
23
24option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb";
25option java_multiple_files = true;
26option java_outer_classname = "CloudSqlResourcesProto";
27option java_package = "com.google.cloud.sql.v1";
28
29// An entry for an Access Control list.
30message AclEntry {
31  // The allowlisted value for the access control list.
32  string value = 1;
33
34  // The time when this access control entry expires in
35  // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
36  // `2012-11-15T16:19:00.094Z`.
37  google.protobuf.Timestamp expiration_time = 2;
38
39  // Optional. A label to identify this entry.
40  string name = 3 [(google.api.field_behavior) = OPTIONAL];
41
42  // This is always `sql#aclEntry`.
43  string kind = 4;
44}
45
46// An Admin API warning message.
47message ApiWarning {
48  enum SqlApiWarningCode {
49    // An unknown or unset warning type from Cloud SQL API.
50    SQL_API_WARNING_CODE_UNSPECIFIED = 0;
51
52    // Warning when one or more regions are not reachable.  The returned result
53    // set may be incomplete.
54    REGION_UNREACHABLE = 1;
55
56    // Warning when user provided maxResults parameter exceeds the limit.  The
57    // returned result set may be incomplete.
58    MAX_RESULTS_EXCEEDS_LIMIT = 2;
59
60    // Warning when user tries to create/update a user with credentials that
61    // have previously been compromised by a public data breach.
62    COMPROMISED_CREDENTIALS = 3;
63
64    // Warning when the operation succeeds but some non-critical workflow state
65    // failed.
66    INTERNAL_STATE_FAILURE = 4;
67  }
68
69  // Code to uniquely identify the warning type.
70  SqlApiWarningCode code = 1;
71
72  // The warning message.
73  string message = 2;
74
75  // The region name for REGION_UNREACHABLE warning.
76  string region = 3;
77}
78
79// We currently only support backup retention by specifying the number
80// of backups we will retain.
81message BackupRetentionSettings {
82  // The units that retained_backups specifies, we only support COUNT.
83  enum RetentionUnit {
84    // Backup retention unit is unspecified, will be treated as COUNT.
85    RETENTION_UNIT_UNSPECIFIED = 0;
86
87    // Retention will be by count, eg. "retain the most recent 7 backups".
88    COUNT = 1;
89  }
90
91  // The unit that 'retained_backups' represents.
92  RetentionUnit retention_unit = 1;
93
94  // Depending on the value of retention_unit, this is used to determine
95  // if a backup needs to be deleted.  If retention_unit is 'COUNT', we will
96  // retain this many backups.
97  google.protobuf.Int32Value retained_backups = 2;
98}
99
100// Database instance backup configuration.
101message BackupConfiguration {
102  // Start time for the daily backup configuration in UTC timezone in the 24
103  // hour format - `HH:MM`.
104  string start_time = 1;
105
106  // Whether this configuration is enabled.
107  google.protobuf.BoolValue enabled = 2;
108
109  // This is always `sql#backupConfiguration`.
110  string kind = 3;
111
112  // (MySQL only) Whether binary log is enabled. If backup configuration is
113  // disabled, binarylog must be disabled as well.
114  google.protobuf.BoolValue binary_log_enabled = 4;
115
116  // Reserved for future use.
117  google.protobuf.BoolValue replication_log_archiving_enabled = 5;
118
119  // Location of the backup
120  string location = 6;
121
122  // Whether point in time recovery is enabled.
123  google.protobuf.BoolValue point_in_time_recovery_enabled = 7;
124
125  // Backup retention settings.
126  BackupRetentionSettings backup_retention_settings = 8;
127
128  // The number of days of transaction logs we retain for point in time
129  // restore, from 1-7.
130  google.protobuf.Int32Value transaction_log_retention_days = 9;
131}
132
133// Perform disk shrink context.
134message PerformDiskShrinkContext {
135  // The target disk shrink size in GigaBytes.
136  int64 target_size_gb = 1;
137}
138
139// Backup context.
140message BackupContext {
141  // The identifier of the backup.
142  int64 backup_id = 1;
143
144  // This is always `sql#backupContext`.
145  string kind = 2;
146}
147
148// Represents a SQL database on the Cloud SQL instance.
149message Database {
150  // This is always `sql#database`.
151  string kind = 1;
152
153  // The Cloud SQL charset value.
154  string charset = 2;
155
156  // The Cloud SQL collation value.
157  string collation = 3;
158
159  // This field is deprecated and will be removed from a future version of the
160  // API.
161  string etag = 4;
162
163  // The name of the database in the Cloud SQL instance. This does not include
164  // the project ID or instance name.
165  string name = 5;
166
167  // The name of the Cloud SQL instance. This does not include the project ID.
168  string instance = 6;
169
170  // The URI of this resource.
171  string self_link = 7;
172
173  // The project ID of the project containing the Cloud SQL database. The Google
174  // apps domain is prefixed if applicable.
175  string project = 8;
176
177  oneof database_details {
178    SqlServerDatabaseDetails sqlserver_database_details = 9;
179  }
180}
181
182// Represents a Sql Server database on the Cloud SQL instance.
183message SqlServerDatabaseDetails {
184  // The version of SQL Server with which the database is to be made compatible
185  int32 compatibility_level = 1;
186
187  // The recovery model of a SQL Server database
188  string recovery_model = 2;
189}
190
191// Database flags for Cloud SQL instances.
192message DatabaseFlags {
193  // The name of the flag. These flags are passed at instance startup, so
194  // include both server options and system variables. Flags are
195  // specified with underscores, not hyphens. For more information, see
196  // [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
197  // in the Cloud SQL documentation.
198  string name = 1;
199
200  // The value of the flag. Boolean flags are set to `on` for true
201  // and `off` for false. This field must be omitted if the flag
202  // doesn't take a value.
203  string value = 2;
204}
205
206// MySQL-specific external server sync settings.
207message MySqlSyncConfig {
208  // Flags to use for the initial dump.
209  repeated SyncFlags initial_sync_flags = 1;
210}
211
212// Initial sync flags for certain Cloud SQL APIs.
213// Currently used for the MySQL external server initial dump.
214message SyncFlags {
215  // The name of the flag.
216  string name = 1;
217
218  // The value of the flag. This field must be omitted if the flag
219  // doesn't take a value.
220  string value = 2;
221}
222
223// Reference to another Cloud SQL instance.
224message InstanceReference {
225  // The name of the Cloud SQL instance being referenced.
226  // This does not include the project ID.
227  string name = 1;
228
229  // The region of the Cloud SQL instance being referenced.
230  string region = 2;
231
232  // The project ID of the Cloud SQL instance being referenced.
233  // The default is the same project ID as the instance references it.
234  string project = 3;
235}
236
237// Read-replica configuration for connecting to the on-premises primary
238// instance.
239message DemoteMasterConfiguration {
240  // This is always `sql#demoteMasterConfiguration`.
241  string kind = 1;
242
243  // MySQL specific configuration when replicating from a MySQL on-premises
244  // primary instance. Replication configuration information such as the
245  // username, password, certificates, and keys are not stored in the instance
246  // metadata. The configuration information is used only to set up the
247  // replication connection and is stored by MySQL in a file named
248  // `master.info` in the data directory.
249  DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2;
250}
251
252// Read-replica configuration specific to MySQL databases.
253message DemoteMasterMySqlReplicaConfiguration {
254  // This is always `sql#demoteMasterMysqlReplicaConfiguration`.
255  string kind = 1;
256
257  // The username for the replication connection.
258  string username = 2;
259
260  // The password for the replication connection.
261  string password = 3;
262
263  // PEM representation of the replica's private key. The corresponsing public
264  // key is encoded in the client's certificate. The format of the replica's
265  // private key can be either PKCS #1 or PKCS #8.
266  string client_key = 4;
267
268  // PEM representation of the replica's x509 certificate.
269  string client_certificate = 5;
270
271  // PEM representation of the trusted CA's x509 certificate.
272  string ca_certificate = 6;
273}
274
275enum SqlFileType {
276  // Unknown file type.
277  SQL_FILE_TYPE_UNSPECIFIED = 0;
278
279  // File containing SQL statements.
280  SQL = 1;
281
282  // File in CSV format.
283  CSV = 2;
284
285  BAK = 4;
286}
287
288// Database instance export context.
289message ExportContext {
290  message SqlCsvExportOptions {
291    // The select query used to extract the data.
292    string select_query = 1;
293
294    // Specifies the character that should appear before a data character that
295    // needs to be escaped.
296    string escape_character = 2;
297
298    // Specifies the quoting character to be used when a data value is quoted.
299    string quote_character = 3;
300
301    // Specifies the character that separates columns within each row (line) of
302    // the file.
303    string fields_terminated_by = 4;
304
305    // This is used to separate lines. If a line does not contain all fields,
306    // the rest of the columns are set to their default values.
307    string lines_terminated_by = 6;
308  }
309
310  message SqlExportOptions {
311    // Options for exporting from MySQL.
312    message MysqlExportOptions {
313      // Option to include SQL statement required to set up replication. If set
314      // to `1`, the dump file includes a CHANGE MASTER TO statement with the
315      // binary log coordinates, and --set-gtid-purged is set to ON. If set to
316      // `2`, the CHANGE MASTER TO statement is written as a SQL comment and
317      // has no effect. If set to any value other than `1`, --set-gtid-purged
318      // is set to OFF.
319      google.protobuf.Int32Value master_data = 1;
320    }
321
322    // Tables to export, or that were exported, from the specified database. If
323    // you specify tables, specify one and only one database. For PostgreSQL
324    // instances, you can specify only one table.
325    repeated string tables = 1;
326
327    // Export only schemas.
328    google.protobuf.BoolValue schema_only = 2;
329
330    MysqlExportOptions mysql_export_options = 3;
331
332    // Optional. The number of threads to use for parallel export.
333    google.protobuf.Int32Value threads = 4
334        [(google.api.field_behavior) = OPTIONAL];
335
336    // Optional. Whether or not the export should be parallel.
337    google.protobuf.BoolValue parallel = 5
338        [(google.api.field_behavior) = OPTIONAL];
339  }
340
341  // Options for exporting BAK files (SQL Server-only)
342  message SqlBakExportOptions {
343    // Whether or not the export should be striped.
344    google.protobuf.BoolValue striped = 1;
345
346    // Option for specifying how many stripes to use for the export.
347    // If blank, and the value of the striped field is true,
348    // the number of stripes is automatically chosen.
349    google.protobuf.Int32Value stripe_count = 2;
350
351    // Type of this bak file will be export, FULL or DIFF, SQL Server only
352    BakType bak_type = 4;
353
354    // Deprecated: copy_only is deprecated. Use differential_base instead
355    google.protobuf.BoolValue copy_only = 5 [deprecated = true];
356
357    // Whether or not the backup can be used as a differential base
358    // copy_only backup can not be served as differential base
359    google.protobuf.BoolValue differential_base = 6;
360  }
361
362  // The path to the file in Google Cloud Storage where the export will be
363  // stored. The URI is in the form `gs://bucketName/fileName`. If the file
364  // already exists, the request succeeds, but the operation fails. If
365  // `fileType` is `SQL` and the filename ends with .gz,
366  // the contents are compressed.
367  string uri = 1;
368
369  // Databases to be exported. <br /> `MySQL instances:` If
370  // `fileType` is `SQL` and no database is specified, all
371  // databases are exported, except for the `mysql` system database.
372  // If `fileType` is `CSV`, you can specify one database,
373  // either by using this property or by using the
374  // `csvExportOptions.selectQuery` property, which takes precedence
375  // over this property. <br /> `PostgreSQL instances:` You must specify
376  // one database to be exported. If `fileType` is `CSV`,
377  // this database must match the one specified in the
378  // `csvExportOptions.selectQuery` property. <br /> `SQL Server
379  // instances:` You must specify one database to be exported, and the
380  // `fileType` must be `BAK`.
381  repeated string databases = 2;
382
383  // This is always `sql#exportContext`.
384  string kind = 3;
385
386  // Options for exporting data as SQL statements.
387  SqlExportOptions sql_export_options = 4;
388
389  // Options for exporting data as CSV. `MySQL` and `PostgreSQL`
390  // instances only.
391  SqlCsvExportOptions csv_export_options = 5;
392
393  // The file type for the specified uri.
394  SqlFileType file_type = 6;
395
396  // Option for export offload.
397  google.protobuf.BoolValue offload = 8;
398
399  // Options for exporting data as BAK files.
400  SqlBakExportOptions bak_export_options = 9;
401}
402
403// Database instance import context.
404message ImportContext {
405  message SqlCsvImportOptions {
406    // The table to which CSV data is imported.
407    string table = 1;
408
409    // The columns to which CSV data is imported. If not specified, all columns
410    // of the database table are loaded with CSV data.
411    repeated string columns = 2;
412
413    // Specifies the character that should appear before a data character that
414    // needs to be escaped.
415    string escape_character = 4;
416
417    // Specifies the quoting character to be used when a data value is quoted.
418    string quote_character = 5;
419
420    // Specifies the character that separates columns within each row (line) of
421    // the file.
422    string fields_terminated_by = 6;
423
424    // This is used to separate lines. If a line does not contain all fields,
425    // the rest of the columns are set to their default values.
426    string lines_terminated_by = 8;
427  }
428
429  message SqlBakImportOptions {
430    message EncryptionOptions {
431      // Path to the Certificate (.cer) in Cloud Storage, in the form
432      // `gs://bucketName/fileName`. The instance must have
433      // write permissions to the bucket and read access to the file.
434      string cert_path = 1;
435
436      // Path to the Certificate Private Key (.pvk)  in Cloud Storage, in the
437      // form `gs://bucketName/fileName`. The instance must have
438      // write permissions to the bucket and read access to the file.
439      string pvk_path = 2;
440
441      // Password that encrypts the private key
442      string pvk_password = 3;
443    }
444
445    EncryptionOptions encryption_options = 1;
446
447    // Whether or not the backup set being restored is striped.
448    // Applies only to Cloud SQL for SQL Server.
449    google.protobuf.BoolValue striped = 2;
450
451    // Whether or not the backup importing will restore database
452    // with NORECOVERY option
453    // Applies only to Cloud SQL for SQL Server.
454    google.protobuf.BoolValue no_recovery = 4;
455
456    // Whether or not the backup importing request will just bring database
457    // online without downloading Bak content only one of "no_recovery" and
458    // "recovery_only" can be true otherwise error will return. Applies only to
459    // Cloud SQL for SQL Server.
460    google.protobuf.BoolValue recovery_only = 5;
461
462    // Type of the bak content, FULL or DIFF
463    BakType bak_type = 6;
464
465    // Optional. The timestamp when the import should stop. This timestamp is in
466    // the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
467    // `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
468    // keyword and applies to Cloud SQL for SQL Server only.
469    google.protobuf.Timestamp stop_at = 7
470        [(google.api.field_behavior) = OPTIONAL];
471
472    // Optional. The marked transaction where the import should stop. This field
473    // is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
474    // Server only.
475    string stop_at_mark = 8 [(google.api.field_behavior) = OPTIONAL];
476  }
477
478  // Path to the import file in Cloud Storage, in the form
479  // `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
480  // when `fileType` is `SQL`. The instance must have
481  // write permissions to the bucket and read access to the file.
482  string uri = 1;
483
484  // The target database for the import. If `fileType` is `SQL`, this field
485  // is required only if the import file does not specify a database, and is
486  // overridden by any database specification in the import file. If
487  // `fileType` is `CSV`, one database must be specified.
488  string database = 2;
489
490  // This is always `sql#importContext`.
491  string kind = 3;
492
493  // The file type for the specified uri.\`SQL`: The file
494  // contains SQL statements. \`CSV`: The file contains CSV data.
495  SqlFileType file_type = 4;
496
497  // Options for importing data as CSV.
498  SqlCsvImportOptions csv_import_options = 5;
499
500  // The PostgreSQL user for this import operation. PostgreSQL instances only.
501  string import_user = 6;
502
503  // Import parameters specific to SQL Server .BAK files
504  SqlBakImportOptions bak_import_options = 7;
505}
506
507enum BakType {
508  // Default type.
509  BAK_TYPE_UNSPECIFIED = 0;
510
511  // Full backup.
512  FULL = 1;
513
514  // Differential backup.
515  DIFF = 2;
516
517  // Transaction Log backup
518  TLOG = 3;
519}
520
521// IP Management configuration.
522message IpConfiguration {
523  // The SSL options for database connections.
524  enum SslMode {
525    // The SSL mode is unknown.
526    SSL_MODE_UNSPECIFIED = 0;
527
528    // Allow non-SSL/non-TLS and SSL/TLS connections. For SSL/TLS connections,
529    // the client certificate won't be verified.
530    // When this value is used, the legacy `require_ssl` flag must be false or
531    // cleared to avoid the conflict between values of two flags.
532    ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1;
533
534    // Only allow connections encrypted with SSL/TLS.
535    // When this value is used, the legacy `require_ssl` flag must be false or
536    // cleared to avoid the conflict between values of two flags.
537    ENCRYPTED_ONLY = 2;
538
539    // Only allow connections encrypted with SSL/TLS and with valid
540    // client certificates.
541    // When this value is used, the legacy `require_ssl` flag must be true or
542    // cleared to avoid the conflict between values of two flags.
543    // PostgreSQL clients or users that connect using IAM database
544    // authentication must use either the
545    // [Cloud SQL Auth
546    // Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
547    // [Cloud SQL
548    // Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
549    // to enforce client identity verification.
550    TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3;
551  }
552
553  // Whether the instance is assigned a public IP address or not.
554  google.protobuf.BoolValue ipv4_enabled = 1;
555
556  // The resource link for the VPC network from which the Cloud SQL instance is
557  // accessible for private IP. For example,
558  // `/projects/myProject/global/networks/default`. This setting can
559  // be updated, but it cannot be removed after it is set.
560  string private_network = 2;
561
562  // Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag.
563  //
564  // Whether SSL/TLS connections over IP are enforced.
565  // If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
566  // For SSL/TLS connections, the client certificate won't be verified. If
567  // set to true, then only allow connections encrypted with SSL/TLS and with
568  // valid client certificates. If you want to enforce SSL/TLS without enforcing
569  // the requirement for valid client certificates, then use the `ssl_mode` flag
570  // instead of the `require_ssl` flag.
571  google.protobuf.BoolValue require_ssl = 3;
572
573  // The list of external networks that are allowed to connect to the instance
574  // using the IP. In 'CIDR' notation, also known as 'slash' notation (for
575  // example: `157.197.200.0/24`).
576  repeated AclEntry authorized_networks = 4;
577
578  // The name of the allocated ip range for the private ip Cloud SQL instance.
579  // For example: "google-managed-services-default". If set, the instance ip
580  // will be created in the allocated range. The range name must comply with
581  // [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
582  // must be 1-63 characters long and match the regular expression
583  // `[a-z]([-a-z0-9]*[a-z0-9])?.`
584  string allocated_ip_range = 6;
585
586  // Controls connectivity to private IP instances from Google services,
587  // such as BigQuery.
588  google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7;
589
590  // Specify how SSL/TLS is enforced in database connections. MySQL and
591  // PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag
592  // for backward compatibility, then only the following value pairs are valid:
593  //
594  // * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
595  // * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
596  // * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
597  //
598  // The value of `ssl_mode` gets priority over the value of `require_ssl`. For
599  // example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`,
600  // the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the
601  // `require_ssl=false` means accept both non-SSL and SSL connections. MySQL
602  // and PostgreSQL databases respect `ssl_mode` in this case and accept only
603  // SSL connections.
604  //
605  // SQL Server uses the `require_ssl` flag. You can set the value for this flag
606  // to `true` or `false`.
607  SslMode ssl_mode = 8;
608
609  // PSC settings for this instance.
610  optional PscConfig psc_config = 9;
611}
612
613// PSC settings for a Cloud SQL instance.
614message PscConfig {
615  // Whether PSC connectivity is enabled for this instance.
616  optional bool psc_enabled = 1;
617
618  // Optional. The list of consumer projects that are allow-listed for PSC
619  // connections to this instance. This instance can be connected to with PSC
620  // from any network in these projects.
621  //
622  // Each consumer project in this list may be represented by a project number
623  // (numeric) or by a project id (alphanumeric).
624  repeated string allowed_consumer_projects = 2
625      [(google.api.field_behavior) = OPTIONAL];
626}
627
628// Preferred location. This specifies where a Cloud SQL instance is located.
629// Note that if the preferred location is not available, the instance will be
630// located as close as possible within the region. Only one location may be
631// specified.
632message LocationPreference {
633  // The App Engine application to follow, it must be in the same region as the
634  // Cloud SQL instance. WARNING: Changing this might restart the instance.
635  string follow_gae_application = 1 [deprecated = true];
636
637  // The preferred Compute Engine zone (for example: us-central1-a,
638  // us-central1-b, etc.). WARNING: Changing this might restart the instance.
639  string zone = 2;
640
641  // The preferred Compute Engine zone for the secondary/failover
642  // (for example: us-central1-a, us-central1-b, etc.).
643  // To disable this field, set it to 'no_secondary_zone'.
644  string secondary_zone = 4;
645
646  // This is always `sql#locationPreference`.
647  string kind = 3;
648}
649
650// Maintenance window. This specifies when a Cloud SQL instance is
651// restarted for system maintenance purposes.
652message MaintenanceWindow {
653  // hour of day - 0 to 23.
654  google.protobuf.Int32Value hour = 1;
655
656  // day of week (1-7), starting on Monday.
657  google.protobuf.Int32Value day = 2;
658
659  // Maintenance timing setting: `canary` (Earlier) or `stable` (Later).
660  // [Learn
661  // more](https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen).
662  SqlUpdateTrack update_track = 3;
663
664  // This is always `sql#maintenanceWindow`.
665  string kind = 4;
666}
667
668// Deny maintenance Periods. This specifies a date range during when all CSA
669// rollout will be denied.
670message DenyMaintenancePeriod {
671  // "deny maintenance period" start date. If the year of the start date is
672  // empty, the year of the end date also must be empty. In this case, it means
673  // the deny maintenance period recurs every year. The date is in format
674  // yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
675  string start_date = 1;
676
677  // "deny maintenance period" end date. If the year of the end date is empty,
678  // the year of the start date also must be empty. In this case, it means the
679  // no maintenance interval recurs every year. The date is in format yyyy-mm-dd
680  // i.e., 2020-11-01, or mm-dd, i.e., 11-01
681  string end_date = 2;
682
683  // Time in UTC when the "deny maintenance period" starts on start_date and
684  // ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
685  string time = 3;
686}
687
688// Insights configuration. This specifies when Cloud SQL Insights feature is
689// enabled and optional configuration.
690message InsightsConfig {
691  // Whether Query Insights feature is enabled.
692  bool query_insights_enabled = 1;
693
694  // Whether Query Insights will record client address when enabled.
695  bool record_client_address = 2;
696
697  // Whether Query Insights will record application tags from query when
698  // enabled.
699  bool record_application_tags = 3;
700
701  // Maximum query length stored in bytes. Default value: 1024 bytes.
702  // Range: 256-4500 bytes. Query length more than this field value will be
703  // truncated to this value. When unset, query length will be the default
704  // value. Changing query length will restart the database.
705  google.protobuf.Int32Value query_string_length = 4;
706
707  // Number of query execution plans captured by Insights per minute
708  // for all queries combined. Default is 5.
709  google.protobuf.Int32Value query_plans_per_minute = 5;
710}
711
712// Read-replica configuration specific to MySQL databases.
713message MySqlReplicaConfiguration {
714  // Path to a SQL dump file in Google Cloud Storage from which the replica
715  // instance is to be created. The URI is in the form gs://bucketName/fileName.
716  // Compressed gzip files (.gz) are also supported.
717  // Dumps have the binlog co-ordinates from which replication
718  // begins. This can be accomplished by setting --master-data to 1 when using
719  // mysqldump.
720  string dump_file_path = 1;
721
722  // The username for the replication connection.
723  string username = 2;
724
725  // The password for the replication connection.
726  string password = 3;
727
728  // Seconds to wait between connect retries. MySQL's default is 60 seconds.
729  google.protobuf.Int32Value connect_retry_interval = 4;
730
731  // Interval in milliseconds between replication heartbeats.
732  google.protobuf.Int64Value master_heartbeat_period = 5;
733
734  // PEM representation of the trusted CA's x509 certificate.
735  string ca_certificate = 6;
736
737  // PEM representation of the replica's x509 certificate.
738  string client_certificate = 7;
739
740  // PEM representation of the replica's private key. The corresponsing public
741  // key is encoded in the client's certificate.
742  string client_key = 8;
743
744  // A list of permissible ciphers to use for SSL encryption.
745  string ssl_cipher = 9;
746
747  // Whether or not to check the primary instance's Common Name value in the
748  // certificate that it sends during the SSL handshake.
749  google.protobuf.BoolValue verify_server_certificate = 10;
750
751  // This is always `sql#mysqlReplicaConfiguration`.
752  string kind = 11;
753}
754
755// Disk encryption configuration for an instance.
756message DiskEncryptionConfiguration {
757  // Resource name of KMS key for disk encryption
758  string kms_key_name = 1;
759
760  // This is always `sql#diskEncryptionConfiguration`.
761  string kind = 2;
762}
763
764// Disk encryption status for an instance.
765message DiskEncryptionStatus {
766  // KMS key version used to encrypt the Cloud SQL instance resource
767  string kms_key_version_name = 1;
768
769  // This is always `sql#diskEncryptionStatus`.
770  string kind = 2;
771}
772
773// Database instance IP mapping
774message IpMapping {
775  // The type of this IP address. A `PRIMARY` address is a public address that
776  // can accept incoming connections. A `PRIVATE` address is a private address
777  // that can accept incoming connections. An `OUTGOING` address is the source
778  // address of connections originating from the instance, if supported.
779  SqlIpAddressType type = 1;
780
781  // The IP address assigned.
782  string ip_address = 2;
783
784  // The due time for this IP to be retired in
785  // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
786  // `2012-11-15T16:19:00.094Z`. This field is only available when
787  // the IP is scheduled to be retired.
788  google.protobuf.Timestamp time_to_retire = 3;
789}
790
791// An Operation resource.&nbsp;For successful operations that return an
792// Operation resource, only the fields relevant to the operation are populated
793// in the resource.
794message Operation {
795  // The type of Cloud SQL operation.
796  enum SqlOperationType {
797    // Unknown operation type.
798    SQL_OPERATION_TYPE_UNSPECIFIED = 0;
799
800    // Imports data into a Cloud SQL instance.
801    IMPORT = 1;
802
803    // Exports data from a Cloud SQL instance to a Cloud Storage
804    // bucket.
805    EXPORT = 2;
806
807    // Creates a new Cloud SQL instance.
808    CREATE = 3;
809
810    // Updates the settings of a Cloud SQL instance.
811    UPDATE = 4;
812
813    // Deletes a Cloud SQL instance.
814    DELETE = 5;
815
816    // Restarts the Cloud SQL instance.
817    RESTART = 6;
818
819    BACKUP = 7 [deprecated = true];
820
821    SNAPSHOT = 8 [deprecated = true];
822
823    // Performs instance backup.
824    BACKUP_VOLUME = 9;
825
826    // Deletes an instance backup.
827    DELETE_VOLUME = 10;
828
829    // Restores an instance backup.
830    RESTORE_VOLUME = 11;
831
832    // Injects a privileged user in mysql for MOB instances.
833    INJECT_USER = 12;
834
835    // Clones a Cloud SQL instance.
836    CLONE = 14;
837
838    // Stops replication on a Cloud SQL read replica instance.
839    STOP_REPLICA = 15;
840
841    // Starts replication on a Cloud SQL read replica instance.
842    START_REPLICA = 16;
843
844    // Promotes a Cloud SQL replica instance.
845    PROMOTE_REPLICA = 17;
846
847    // Creates a Cloud SQL replica instance.
848    CREATE_REPLICA = 18;
849
850    // Creates a new user in a Cloud SQL instance.
851    CREATE_USER = 19;
852
853    // Deletes a user from a Cloud SQL instance.
854    DELETE_USER = 20;
855
856    // Updates an existing user in a Cloud SQL instance.
857    UPDATE_USER = 21;
858
859    // Creates a database in the Cloud SQL instance.
860    CREATE_DATABASE = 22;
861
862    // Deletes a database in the Cloud SQL instance.
863    DELETE_DATABASE = 23;
864
865    // Updates a database in the Cloud SQL instance.
866    UPDATE_DATABASE = 24;
867
868    // Performs failover of an HA-enabled Cloud SQL
869    // failover replica.
870    FAILOVER = 25;
871
872    // Deletes the backup taken by a backup run.
873    DELETE_BACKUP = 26;
874
875    RECREATE_REPLICA = 27;
876
877    // Truncates a general or slow log table in MySQL.
878    TRUNCATE_LOG = 28;
879
880    // Demotes the stand-alone instance to be a Cloud SQL
881    // read replica for an external database server.
882    DEMOTE_MASTER = 29;
883
884    // Indicates that the instance is currently in maintenance. Maintenance
885    // typically causes the instance to be unavailable for 1-3 minutes.
886    MAINTENANCE = 30;
887
888    // This field is deprecated, and will be removed in future version of API.
889    ENABLE_PRIVATE_IP = 31 [deprecated = true];
890
891    DEFER_MAINTENANCE = 32 [deprecated = true];
892
893    // Creates clone instance.
894    CREATE_CLONE = 33 [deprecated = true];
895
896    // Reschedule maintenance to another time.
897    RESCHEDULE_MAINTENANCE = 34;
898
899    // Starts external sync of a Cloud SQL EM replica to an external primary
900    // instance.
901    START_EXTERNAL_SYNC = 35;
902
903    // Recovers logs from an instance's old data disk.
904    LOG_CLEANUP = 36;
905
906    // Performs auto-restart of an HA-enabled Cloud SQL database for auto
907    // recovery.
908    AUTO_RESTART = 37;
909
910    // Re-encrypts CMEK instances with latest key version.
911    REENCRYPT = 38;
912
913    // Switches over to replica instance from primary.
914    SWITCHOVER = 39;
915  }
916
917  // The status of an operation.
918  enum SqlOperationStatus {
919    // The state of the operation is unknown.
920    SQL_OPERATION_STATUS_UNSPECIFIED = 0;
921
922    // The operation has been queued, but has not started yet.
923    PENDING = 1;
924
925    // The operation is running.
926    RUNNING = 2;
927
928    // The operation completed.
929    DONE = 3;
930  }
931
932  // This is always `sql#operation`.
933  string kind = 1;
934
935  string target_link = 2;
936
937  // The status of an operation.
938  SqlOperationStatus status = 3;
939
940  // The email address of the user who initiated this operation.
941  string user = 4;
942
943  // The time this operation was enqueued in UTC timezone in [RFC
944  // 3339](https://tools.ietf.org/html/rfc3339) format, for example
945  // `2012-11-15T16:19:00.094Z`.
946  google.protobuf.Timestamp insert_time = 5;
947
948  // The time this operation actually started in UTC timezone in [RFC
949  // 3339](https://tools.ietf.org/html/rfc3339) format, for example
950  // `2012-11-15T16:19:00.094Z`.
951  google.protobuf.Timestamp start_time = 6;
952
953  // The time this operation finished in UTC timezone in [RFC
954  // 3339](https://tools.ietf.org/html/rfc3339) format, for example
955  // `2012-11-15T16:19:00.094Z`.
956  google.protobuf.Timestamp end_time = 7;
957
958  // If errors occurred during processing of this operation, this field will be
959  // populated.
960  OperationErrors error = 8;
961
962  // An Admin API warning message.
963  ApiWarning api_warning = 19;
964
965  // The type of the operation. Valid values are:
966  // *  `CREATE`
967  // *  `DELETE`
968  // *  `UPDATE`
969  // *  `RESTART`
970  // *  `IMPORT`
971  // *  `EXPORT`
972  // *  `BACKUP_VOLUME`
973  // *  `RESTORE_VOLUME`
974  // *  `CREATE_USER`
975  // *  `DELETE_USER`
976  // *  `CREATE_DATABASE`
977  // *  `DELETE_DATABASE`
978  SqlOperationType operation_type = 9;
979
980  // The context for import operation, if applicable.
981  ImportContext import_context = 10;
982
983  // The context for export operation, if applicable.
984  ExportContext export_context = 11;
985
986  // The context for backup operation, if applicable.
987  BackupContext backup_context = 17;
988
989  // An identifier that uniquely identifies the operation. You can use this
990  // identifier to retrieve the Operations resource that has information about
991  // the operation.
992  string name = 12;
993
994  // Name of the database instance related to this operation.
995  string target_id = 13;
996
997  // The URI of this resource.
998  string self_link = 14;
999
1000  // The project ID of the target instance related to this operation.
1001  string target_project = 15;
1002}
1003
1004// Database instance operation error.
1005message OperationError {
1006  // This is always `sql#operationError`.
1007  string kind = 1;
1008
1009  // Identifies the specific error that occurred.
1010  string code = 2;
1011
1012  // Additional information about the error encountered.
1013  string message = 3;
1014}
1015
1016// Database instance operation errors list wrapper.
1017message OperationErrors {
1018  // This is always `sql#operationErrors`.
1019  string kind = 1;
1020
1021  // The list of errors encountered while processing this operation.
1022  repeated OperationError errors = 2;
1023}
1024
1025// Database instance local user password validation policy
1026message PasswordValidationPolicy {
1027  // The complexity choices of the password.
1028  enum Complexity {
1029    // Complexity check is not specified.
1030    COMPLEXITY_UNSPECIFIED = 0;
1031
1032    // A combination of lowercase, uppercase, numeric, and non-alphanumeric
1033    // characters.
1034    COMPLEXITY_DEFAULT = 1;
1035  }
1036
1037  // Minimum number of characters allowed.
1038  google.protobuf.Int32Value min_length = 1;
1039
1040  // The complexity of the password.
1041  Complexity complexity = 2;
1042
1043  // Number of previous passwords that cannot be reused.
1044  google.protobuf.Int32Value reuse_interval = 3;
1045
1046  // Disallow username as a part of the password.
1047  google.protobuf.BoolValue disallow_username_substring = 4;
1048
1049  // Minimum interval after which the password can be changed. This flag is only
1050  // supported for PostgreSQL.
1051  google.protobuf.Duration password_change_interval = 5;
1052
1053  // Whether the password policy is enabled or not.
1054  google.protobuf.BoolValue enable_password_policy = 6;
1055
1056  // This field is deprecated and will be removed in a future version of the
1057  // API.
1058  google.protobuf.BoolValue disallow_compromised_credentials = 7
1059      [deprecated = true];
1060}
1061
1062// Data cache configurations.
1063message DataCacheConfig {
1064  // Whether data cache is enabled for the instance.
1065  bool data_cache_enabled = 1;
1066}
1067
1068// Database instance settings.
1069message Settings {
1070  // Specifies when the instance is activated.
1071  enum SqlActivationPolicy {
1072    // Unknown activation plan.
1073    SQL_ACTIVATION_POLICY_UNSPECIFIED = 0;
1074
1075    // The instance is always up and running.
1076    ALWAYS = 1;
1077
1078    // The instance never starts.
1079    NEVER = 2;
1080
1081    // The instance starts upon receiving requests.
1082    ON_DEMAND = 3 [deprecated = true];
1083  }
1084
1085  // The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
1086  enum Edition {
1087    // The instance did not specify the edition.
1088    EDITION_UNSPECIFIED = 0;
1089
1090    // The instance is an enterprise edition.
1091    ENTERPRISE = 2;
1092
1093    // The instance is an Enterprise Plus edition.
1094    ENTERPRISE_PLUS = 3;
1095  }
1096
1097  // The options for enforcing Cloud SQL connectors in the instance.
1098  enum ConnectorEnforcement {
1099    // The requirement for Cloud SQL connectors is unknown.
1100    CONNECTOR_ENFORCEMENT_UNSPECIFIED = 0;
1101
1102    // Do not require Cloud SQL connectors.
1103    NOT_REQUIRED = 1;
1104
1105    // Require all connections to use Cloud SQL connectors, including the
1106    // Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
1107    // Note: This disables all existing authorized networks.
1108    REQUIRED = 2;
1109  }
1110
1111  // The version of instance settings. This is a required field for update
1112  // method to make sure concurrent updates are handled properly. During update,
1113  // use the most recent settingsVersion value for this instance and do not try
1114  // to update this value.
1115  google.protobuf.Int64Value settings_version = 1;
1116
1117  // The App Engine app IDs that can access this instance.
1118  // (Deprecated) Applied to First Generation instances only.
1119  repeated string authorized_gae_applications = 2 [deprecated = true];
1120
1121  // The tier (or machine type) for this instance, for example
1122  // `db-custom-1-3840`. WARNING: Changing this restarts the instance.
1123  string tier = 3;
1124
1125  // This is always `sql#settings`.
1126  string kind = 4;
1127
1128  // User-provided labels, represented as a dictionary where each label is a
1129  // single key value pair.
1130  map<string, string> user_labels = 5;
1131
1132  // Availability type. Potential values:
1133  // *  `ZONAL`: The instance serves data from only one zone. Outages in that
1134  // zone affect data accessibility.
1135  // *  `REGIONAL`: The instance can serve data from more than one zone in a
1136  // region (it is highly available)./
1137  //
1138  // For more information, see [Overview of the High Availability
1139  // Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
1140  SqlAvailabilityType availability_type = 6;
1141
1142  // The pricing plan for this instance. This can be either `PER_USE` or
1143  // `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
1144  SqlPricingPlan pricing_plan = 7;
1145
1146  // The type of replication this instance uses. This can be either
1147  // `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
1148  // applicable to First Generation instances.
1149  SqlReplicationType replication_type = 8 [deprecated = true];
1150
1151  // The maximum size to which storage capacity can be automatically increased.
1152  // The default value is 0, which specifies that there is no limit.
1153  google.protobuf.Int64Value storage_auto_resize_limit = 9;
1154
1155  // The activation policy specifies when the instance is activated; it is
1156  // applicable only when the instance state is RUNNABLE. Valid values:
1157  // *  `ALWAYS`: The instance is on, and remains so even in the absence of
1158  // connection requests.
1159  // *  `NEVER`: The instance is off; it is not activated, even if a
1160  // connection request arrives.
1161  SqlActivationPolicy activation_policy = 10;
1162
1163  // The settings for IP Management. This allows to enable or disable the
1164  // instance IP and manage which external networks can connect to the instance.
1165  // The IPv4 address cannot be disabled for Second Generation instances.
1166  IpConfiguration ip_configuration = 11;
1167
1168  // Configuration to increase storage size automatically. The default value is
1169  // true.
1170  google.protobuf.BoolValue storage_auto_resize = 12;
1171
1172  // The location preference settings. This allows the instance to be located as
1173  // near as possible to either an App Engine app or Compute Engine zone for
1174  // better performance. App Engine co-location was only applicable to First
1175  // Generation instances.
1176  LocationPreference location_preference = 13;
1177
1178  // The database flags passed to the instance at startup.
1179  repeated DatabaseFlags database_flags = 14;
1180
1181  // The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
1182  // First Generation instances.
1183  SqlDataDiskType data_disk_type = 15;
1184
1185  // The maintenance window for this instance. This specifies when the instance
1186  // can be restarted for maintenance purposes.
1187  MaintenanceWindow maintenance_window = 16;
1188
1189  // The daily backup configuration for the instance.
1190  BackupConfiguration backup_configuration = 17;
1191
1192  // Configuration specific to read replica instances. Indicates whether
1193  // replication is enabled or not. WARNING: Changing this restarts the
1194  // instance.
1195  google.protobuf.BoolValue database_replication_enabled = 18;
1196
1197  // Configuration specific to read replica instances. Indicates whether
1198  // database flags for crash-safe replication are enabled. This property was
1199  // only applicable to First Generation instances.
1200  google.protobuf.BoolValue crash_safe_replication_enabled = 19
1201      [deprecated = true];
1202
1203  // The size of data disk, in GB. The data disk size minimum is 10GB.
1204  google.protobuf.Int64Value data_disk_size_gb = 20;
1205
1206  // Active Directory configuration, relevant only for Cloud SQL for SQL Server.
1207  SqlActiveDirectoryConfig active_directory_config = 22;
1208
1209  // The name of server Instance collation.
1210  string collation = 23;
1211
1212  // Deny maintenance periods
1213  repeated DenyMaintenancePeriod deny_maintenance_periods = 24;
1214
1215  // Insights configuration, for now relevant only for Postgres.
1216  InsightsConfig insights_config = 25;
1217
1218  // The local user password validation policy of the instance.
1219  PasswordValidationPolicy password_validation_policy = 27;
1220
1221  // SQL Server specific audit configuration.
1222  SqlServerAuditConfig sql_server_audit_config = 29;
1223
1224  // Optional. The edition of the instance.
1225  Edition edition = 38 [(google.api.field_behavior) = OPTIONAL];
1226
1227  // Specifies if connections must use Cloud SQL connectors.
1228  // Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
1229  // can be connected without Cloud SQL
1230  // Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
1231  // Connectors).
1232  //
1233  // Note that using REQUIRED disables all existing authorized networks. If
1234  // this field is not specified when creating a new instance, NOT_REQUIRED is
1235  // used. If this field is not specified when patching or updating an existing
1236  // instance, it is left unchanged in the instance.
1237  ConnectorEnforcement connector_enforcement = 32;
1238
1239  // Configuration to protect against accidental instance deletion.
1240  google.protobuf.BoolValue deletion_protection_enabled = 33;
1241
1242  // Server timezone, relevant only for Cloud SQL for SQL Server.
1243  string time_zone = 34;
1244
1245  // Specifies advance machine configuration for the instance
1246  // relevant only for SQL Server.
1247  AdvancedMachineFeatures advanced_machine_features = 35;
1248
1249  // Configuration for data cache.
1250  DataCacheConfig data_cache_config = 37;
1251}
1252
1253// Specifies options for controlling advanced machine features.
1254message AdvancedMachineFeatures {
1255  // The number of threads per physical core.
1256  int32 threads_per_core = 1;
1257}
1258
1259// SslCerts Resource
1260message SslCert {
1261  // This is always `sql#sslCert`.
1262  string kind = 1;
1263
1264  // Serial number, as extracted from the certificate.
1265  string cert_serial_number = 2;
1266
1267  // PEM representation.
1268  string cert = 3;
1269
1270  // The time when the certificate was created in [RFC
1271  // 3339](https://tools.ietf.org/html/rfc3339) format, for example
1272  // `2012-11-15T16:19:00.094Z`
1273  google.protobuf.Timestamp create_time = 4;
1274
1275  // User supplied name.  Constrained to [a-zA-Z.-_ ]+.
1276  string common_name = 5;
1277
1278  // The time when the certificate expires in [RFC
1279  // 3339](https://tools.ietf.org/html/rfc3339) format, for example
1280  // `2012-11-15T16:19:00.094Z`.
1281  google.protobuf.Timestamp expiration_time = 6;
1282
1283  // Sha1 Fingerprint.
1284  string sha1_fingerprint = 7;
1285
1286  // Name of the database instance.
1287  string instance = 8;
1288
1289  // The URI of this resource.
1290  string self_link = 9;
1291}
1292
1293// SslCertDetail.
1294message SslCertDetail {
1295  // The public information about the cert.
1296  SslCert cert_info = 1;
1297
1298  // The private key for the client cert, in pem format.  Keep private in order
1299  // to protect your security.
1300  string cert_private_key = 2;
1301}
1302
1303// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
1304message SqlActiveDirectoryConfig {
1305  // This is always sql#activeDirectoryConfig.
1306  string kind = 1;
1307
1308  // The name of the domain (e.g., mydomain.com).
1309  string domain = 2;
1310}
1311
1312// SQL Server specific audit configuration.
1313message SqlServerAuditConfig {
1314  // This is always sql#sqlServerAuditConfig
1315  string kind = 1;
1316
1317  // The name of the destination bucket (e.g., gs://mybucket).
1318  string bucket = 2;
1319
1320  // How long to keep generated audit files.
1321  google.protobuf.Duration retention_interval = 3;
1322
1323  // How often to upload generated audit files.
1324  google.protobuf.Duration upload_interval = 4;
1325}
1326
1327enum SqlBackendType {
1328  // This is an unknown backend type for instance.
1329  SQL_BACKEND_TYPE_UNSPECIFIED = 0;
1330
1331  // V1 speckle instance.
1332  FIRST_GEN = 1 [deprecated = true];
1333
1334  // V2 speckle instance.
1335  SECOND_GEN = 2;
1336
1337  // On premises instance.
1338  EXTERNAL = 3;
1339}
1340
1341enum SqlIpAddressType {
1342  // This is an unknown IP address type.
1343  SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0;
1344
1345  // IP address the customer is supposed to connect to. Usually this is the
1346  // load balancer's IP address
1347  PRIMARY = 1;
1348
1349  // Source IP address of the connection a read replica establishes to its
1350  // external primary instance. This IP address can be allowlisted by the
1351  // customer in case it has a firewall that filters incoming connection to its
1352  // on premises primary instance.
1353  OUTGOING = 2;
1354
1355  // Private IP used when using private IPs and network peering.
1356  PRIVATE = 3;
1357
1358  // V1 IP of a migrated instance. We want the user to
1359  // decommission this IP as soon as the migration is complete.
1360  // Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
1361  MIGRATED_1ST_GEN = 4;
1362}
1363
1364// The database engine type and version.
1365enum SqlDatabaseVersion {
1366  // This is an unknown database version.
1367  SQL_DATABASE_VERSION_UNSPECIFIED = 0;
1368
1369  // The database version is MySQL 5.1.
1370  MYSQL_5_1 = 2 [deprecated = true];
1371
1372  // The database version is MySQL 5.5.
1373  MYSQL_5_5 = 3 [deprecated = true];
1374
1375  // The database version is MySQL 5.6.
1376  MYSQL_5_6 = 5;
1377
1378  // The database version is MySQL 5.7.
1379  MYSQL_5_7 = 6;
1380
1381  // The database version is SQL Server 2017 Standard.
1382  SQLSERVER_2017_STANDARD = 11;
1383
1384  // The database version is SQL Server 2017 Enterprise.
1385  SQLSERVER_2017_ENTERPRISE = 14;
1386
1387  // The database version is SQL Server 2017 Express.
1388  SQLSERVER_2017_EXPRESS = 15;
1389
1390  // The database version is SQL Server 2017 Web.
1391  SQLSERVER_2017_WEB = 16;
1392
1393  // The database version is PostgreSQL 9.6.
1394  POSTGRES_9_6 = 9;
1395
1396  // The database version is PostgreSQL 10.
1397  POSTGRES_10 = 18;
1398
1399  // The database version is PostgreSQL 11.
1400  POSTGRES_11 = 10;
1401
1402  // The database version is PostgreSQL 12.
1403  POSTGRES_12 = 19;
1404
1405  // The database version is PostgreSQL 13.
1406  POSTGRES_13 = 23;
1407
1408  // The database version is PostgreSQL 14.
1409  POSTGRES_14 = 110;
1410
1411  // The database version is PostgreSQL 15.
1412  POSTGRES_15 = 172;
1413
1414  // The database version is MySQL 8.
1415  MYSQL_8_0 = 20;
1416
1417  // The database major version is MySQL 8.0 and the minor version is 18.
1418  MYSQL_8_0_18 = 41;
1419
1420  // The database major version is MySQL 8.0 and the minor version is 26.
1421  MYSQL_8_0_26 = 85;
1422
1423  // The database major version is MySQL 8.0 and the minor version is 27.
1424  MYSQL_8_0_27 = 111;
1425
1426  // The database major version is MySQL 8.0 and the minor version is 28.
1427  MYSQL_8_0_28 = 132;
1428
1429  // The database major version is MySQL 8.0 and the minor version is 29.
1430  MYSQL_8_0_29 = 148 [deprecated = true];
1431
1432  // The database major version is MySQL 8.0 and the minor version is 30.
1433  MYSQL_8_0_30 = 174;
1434
1435  // The database major version is MySQL 8.0 and the minor version is 31.
1436  MYSQL_8_0_31 = 197;
1437
1438  // The database major version is MySQL 8.0 and the minor version is 32.
1439  MYSQL_8_0_32 = 213;
1440
1441  // The database major version is MySQL 8.0 and the minor version is 33.
1442  MYSQL_8_0_33 = 238;
1443
1444  // The database major version is MySQL 8.0 and the minor version is 34.
1445  MYSQL_8_0_34 = 239;
1446
1447  // The database major version is MySQL 8.0 and the minor version is 35.
1448  MYSQL_8_0_35 = 240;
1449
1450  // The database major version is MySQL 8.0 and the minor version is 36.
1451  MYSQL_8_0_36 = 241;
1452
1453  // The database version is SQL Server 2019 Standard.
1454  SQLSERVER_2019_STANDARD = 26;
1455
1456  // The database version is SQL Server 2019 Enterprise.
1457  SQLSERVER_2019_ENTERPRISE = 27;
1458
1459  // The database version is SQL Server 2019 Express.
1460  SQLSERVER_2019_EXPRESS = 28;
1461
1462  // The database version is SQL Server 2019 Web.
1463  SQLSERVER_2019_WEB = 29;
1464
1465  // The database version is SQL Server 2022 Standard.
1466  SQLSERVER_2022_STANDARD = 199;
1467
1468  // The database version is SQL Server 2022 Enterprise.
1469  SQLSERVER_2022_ENTERPRISE = 200;
1470
1471  // The database version is SQL Server 2022 Express.
1472  SQLSERVER_2022_EXPRESS = 201;
1473
1474  // The database version is SQL Server 2022 Web.
1475  SQLSERVER_2022_WEB = 202;
1476}
1477
1478// The pricing plan for this instance.
1479enum SqlPricingPlan {
1480  // This is an unknown pricing plan for this instance.
1481  SQL_PRICING_PLAN_UNSPECIFIED = 0;
1482
1483  // The instance is billed at a monthly flat rate.
1484  PACKAGE = 1;
1485
1486  // The instance is billed per usage.
1487  PER_USE = 2;
1488}
1489
1490enum SqlReplicationType {
1491  // This is an unknown replication type for a Cloud SQL instance.
1492  SQL_REPLICATION_TYPE_UNSPECIFIED = 0;
1493
1494  // The synchronous replication mode for First Generation instances. It is the
1495  // default value.
1496  SYNCHRONOUS = 1;
1497
1498  // The asynchronous replication mode for First Generation instances. It
1499  // provides a slight performance gain, but if an outage occurs while this
1500  // option is set to asynchronous, you can lose up to a few seconds of updates
1501  // to your data.
1502  ASYNCHRONOUS = 2;
1503}
1504
1505// The type of disk that is used for a v2 instance to use.
1506enum SqlDataDiskType {
1507  // This is an unknown data disk type.
1508  SQL_DATA_DISK_TYPE_UNSPECIFIED = 0;
1509
1510  // An SSD data disk.
1511  PD_SSD = 1;
1512
1513  // An HDD data disk.
1514  PD_HDD = 2;
1515
1516  // This field is deprecated and will be removed from a future version of the
1517  // API.
1518  OBSOLETE_LOCAL_SSD = 3 [deprecated = true];
1519}
1520
1521// The availability type of the given Cloud SQL instance.
1522enum SqlAvailabilityType {
1523  // This is an unknown Availability type.
1524  SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0;
1525
1526  // Zonal available instance.
1527  ZONAL = 1;
1528
1529  // Regional available instance.
1530  REGIONAL = 2;
1531}
1532
1533enum SqlUpdateTrack {
1534  // This is an unknown maintenance timing preference.
1535  SQL_UPDATE_TRACK_UNSPECIFIED = 0;
1536
1537  // For instance update that requires a restart, this update track indicates
1538  // your instance prefer to restart for new version early in maintenance
1539  // window.
1540  canary = 1;
1541
1542  // For instance update that requires a restart, this update track indicates
1543  // your instance prefer to let Cloud SQL choose the timing of restart (within
1544  // its Maintenance window, if applicable).
1545  stable = 2;
1546
1547  // For instance update that requires a restart, this update track indicates
1548  // your instance prefer to let Cloud SQL choose the timing of restart (within
1549  // its Maintenance window, if applicable) to be at least 5 weeks after the
1550  // notification.
1551  week5 = 3;
1552}
1553