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.v1beta4; 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/apiv1beta4/sqlpb;sqlpb"; 25option java_multiple_files = true; 26option java_outer_classname = "CloudSqlResourcesProto"; 27option java_package = "com.google.cloud.sql.v1beta4"; 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 // The number of days of transaction logs we retain for point in time 126 // restore, from 1-7. 127 google.protobuf.Int32Value transaction_log_retention_days = 9; 128 129 // Backup retention settings. 130 BackupRetentionSettings backup_retention_settings = 10; 131} 132 133// A BackupRun resource. 134message BackupRun { 135 // This is always `sql#backupRun`. 136 string kind = 1; 137 138 // The status of this run. 139 SqlBackupRunStatus status = 2; 140 141 // The time the run was enqueued in UTC timezone in 142 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 143 // `2012-11-15T16:19:00.094Z`. 144 google.protobuf.Timestamp enqueued_time = 3; 145 146 // The identifier for this backup run. Unique only for a specific Cloud SQL 147 // instance. 148 int64 id = 4; 149 150 // The time the backup operation actually started in UTC timezone in 151 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 152 // `2012-11-15T16:19:00.094Z`. 153 google.protobuf.Timestamp start_time = 5; 154 155 // The time the backup operation completed in UTC timezone in 156 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 157 // `2012-11-15T16:19:00.094Z`. 158 google.protobuf.Timestamp end_time = 6; 159 160 // Information about why the backup operation failed. This is only present if 161 // the run has the FAILED status. 162 OperationError error = 7; 163 164 // The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL". 165 // This field defaults to "ON_DEMAND" and is ignored, when specified for 166 // insert requests. 167 SqlBackupRunType type = 8; 168 169 // The description of this run, only applicable to on-demand backups. 170 string description = 9; 171 172 // The start time of the backup window during which this the backup was 173 // attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for 174 // example `2012-11-15T16:19:00.094Z`. 175 google.protobuf.Timestamp window_start_time = 10; 176 177 // Name of the database instance. 178 string instance = 11; 179 180 // The URI of this resource. 181 string self_link = 12; 182 183 // Location of the backups. 184 string location = 13; 185 186 // Encryption configuration specific to a backup. 187 DiskEncryptionConfiguration disk_encryption_configuration = 16; 188 189 // Encryption status specific to a backup. 190 DiskEncryptionStatus disk_encryption_status = 17; 191 192 // Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT. 193 SqlBackupKind backup_kind = 19; 194 195 // Backup time zone to prevent restores to an instance with 196 // a different time zone. Now relevant only for SQL Server. 197 string time_zone = 23; 198} 199 200// Backup run list results. 201message BackupRunsListResponse { 202 // This is always `sql#backupRunsList`. 203 string kind = 1; 204 205 // A list of backup runs in reverse chronological order of the enqueued time. 206 repeated BackupRun items = 2; 207 208 // The continuation token, used to page through large result sets. Provide 209 // this value in a subsequent request to return the next page of results. 210 string next_page_token = 3; 211} 212 213// Binary log coordinates. 214message BinLogCoordinates { 215 // Name of the binary log file for a Cloud SQL instance. 216 string bin_log_file_name = 1; 217 218 // Position (offset) within the binary log file. 219 int64 bin_log_position = 2; 220 221 // This is always `sql#binLogCoordinates`. 222 string kind = 3; 223} 224 225// Backup context. 226message BackupContext { 227 // The identifier of the backup. 228 int64 backup_id = 1; 229 230 // This is always `sql#backupContext`. 231 string kind = 2; 232} 233 234// Database instance clone context. 235message CloneContext { 236 // This is always `sql#cloneContext`. 237 string kind = 1; 238 239 // Reserved for future use. 240 int64 pitr_timestamp_ms = 2; 241 242 // Name of the Cloud SQL instance to be created as a clone. 243 string destination_instance_name = 3; 244 245 // Binary log coordinates, if specified, identify the position up to which the 246 // source instance is cloned. If not specified, the source instance is 247 // cloned up to the most recent binary log coordinates. 248 BinLogCoordinates bin_log_coordinates = 4; 249 250 // Timestamp, if specified, identifies the time to which the source instance 251 // is cloned. 252 google.protobuf.Timestamp point_in_time = 5; 253 254 // The name of the allocated ip range for the private ip Cloud SQL instance. 255 // For example: "google-managed-services-default". If set, the cloned instance 256 // ip will be created in the allocated range. The range name must comply with 257 // [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name 258 // must be 1-63 characters long and match the regular expression 259 // [a-z]([-a-z0-9]*[a-z0-9])?. 260 // Reserved for future use. 261 string allocated_ip_range = 6; 262 263 // (SQL Server only) Clone only the specified databases from the source 264 // instance. Clone all databases if empty. 265 repeated string database_names = 9; 266 267 // Optional. (Point-in-time recovery for PostgreSQL only) Clone to an instance 268 // in the specified zone. If no zone is specified, clone to the same zone as 269 // the source instance. 270 optional string preferred_zone = 10 [(google.api.field_behavior) = OPTIONAL]; 271} 272 273// Represents a SQL database on the Cloud SQL instance. 274message Database { 275 // This is always `sql#database`. 276 string kind = 1; 277 278 // The Cloud SQL charset value. 279 string charset = 2; 280 281 // The Cloud SQL collation value. 282 string collation = 3; 283 284 // This field is deprecated and will be removed from a future version of the 285 // API. 286 string etag = 4; 287 288 // The name of the database in the Cloud SQL instance. This does not include 289 // the project ID or instance name. 290 string name = 5; 291 292 // The name of the Cloud SQL instance. This does not include the project ID. 293 string instance = 6; 294 295 // The URI of this resource. 296 string self_link = 7; 297 298 // The project ID of the project containing the Cloud SQL database. The Google 299 // apps domain is prefixed if applicable. 300 string project = 8; 301 302 oneof database_details { 303 SqlServerDatabaseDetails sqlserver_database_details = 9; 304 } 305} 306 307// Represents a Sql Server database on the Cloud SQL instance. 308message SqlServerDatabaseDetails { 309 // The version of SQL Server with which the database is to be made compatible 310 int32 compatibility_level = 1; 311 312 // The recovery model of a SQL Server database 313 string recovery_model = 2; 314} 315 316// Database flags for Cloud SQL instances. 317message DatabaseFlags { 318 // The name of the flag. These flags are passed at instance startup, so 319 // include both server options and system variables. Flags are 320 // specified with underscores, not hyphens. For more information, see 321 // [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags) 322 // in the Cloud SQL documentation. 323 string name = 1; 324 325 // The value of the flag. Boolean flags are set to `on` for true 326 // and `off` for false. This field must be omitted if the flag 327 // doesn't take a value. 328 string value = 2; 329} 330 331// Initial sync flags for certain Cloud SQL APIs. 332// Currently used for the MySQL external server initial dump. 333message SyncFlags { 334 // The name of the flag. 335 string name = 1; 336 337 // The value of the flag. This field must be omitted if the flag 338 // doesn't take a value. 339 string value = 2; 340} 341 342// Reference to another Cloud SQL instance. 343message InstanceReference { 344 // The name of the Cloud SQL instance being referenced. 345 // This does not include the project ID. 346 string name = 1; 347 348 // The region of the Cloud SQL instance being referenced. 349 string region = 2; 350 351 // The project ID of the Cloud SQL instance being referenced. 352 // The default is the same project ID as the instance references it. 353 string project = 3; 354} 355 356// A Cloud SQL instance resource. 357message DatabaseInstance { 358 // The current serving state of the database instance. 359 enum SqlInstanceState { 360 // The state of the instance is unknown. 361 SQL_INSTANCE_STATE_UNSPECIFIED = 0; 362 363 // The instance is running, or has been stopped by owner. 364 RUNNABLE = 1; 365 366 // The instance is not available, for example due to problems with billing. 367 SUSPENDED = 2; 368 369 // The instance is being deleted. 370 PENDING_DELETE = 3; 371 372 // The instance is being created. 373 PENDING_CREATE = 4; 374 375 // The instance is down for maintenance. 376 MAINTENANCE = 5; 377 378 // The creation of the instance failed or a fatal error occurred during 379 // maintenance. 380 FAILED = 6; 381 382 // Deprecated 383 ONLINE_MAINTENANCE = 7 [deprecated = true]; 384 } 385 386 message SqlFailoverReplica { 387 // The name of the failover replica. If specified at instance creation, a 388 // failover replica is created for the instance. The name 389 // doesn't include the project ID. 390 string name = 1; 391 392 // The availability status of the failover replica. A false status indicates 393 // that the failover replica is out of sync. The primary instance can only 394 // failover to the failover replica when the status is true. 395 google.protobuf.BoolValue available = 2; 396 } 397 398 // Any scheduled maintenance for this instance. 399 message SqlScheduledMaintenance { 400 // The start time of any upcoming scheduled maintenance for this instance. 401 google.protobuf.Timestamp start_time = 1; 402 403 bool can_defer = 2 [deprecated = true]; 404 405 // If the scheduled maintenance can be rescheduled. 406 bool can_reschedule = 3; 407 408 // Maintenance cannot be rescheduled to start beyond this deadline. 409 optional google.protobuf.Timestamp schedule_deadline_time = 4; 410 } 411 412 // This message wraps up the information written by out-of-disk detection job. 413 message SqlOutOfDiskReport { 414 // This enum lists all possible states regarding out-of-disk issues. 415 enum SqlOutOfDiskState { 416 // Unspecified state 417 SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0; 418 419 // The instance has plenty space on data disk 420 NORMAL = 1; 421 422 // Data disk is almost used up. It is shutdown to prevent data 423 // corruption. 424 SOFT_SHUTDOWN = 2; 425 } 426 427 // This field represents the state generated by the proactive database 428 // wellness job for OutOfDisk issues. 429 // * Writers: 430 // * the proactive database wellness job for OOD. 431 // * Readers: 432 // * the proactive database wellness job 433 optional SqlOutOfDiskState sql_out_of_disk_state = 1; 434 435 // The minimum recommended increase size in GigaBytes 436 // This field is consumed by the frontend 437 // * Writers: 438 // * the proactive database wellness job for OOD. 439 // * Readers: 440 optional int32 sql_min_recommended_increase_size_gb = 2; 441 } 442 443 // The SQL network architecture for the instance. 444 enum SqlNetworkArchitecture { 445 SQL_NETWORK_ARCHITECTURE_UNSPECIFIED = 0; 446 447 // The instance uses the new network architecture. 448 NEW_NETWORK_ARCHITECTURE = 1; 449 450 // The instance uses the old network architecture. 451 OLD_NETWORK_ARCHITECTURE = 2; 452 } 453 454 // This is always `sql#instance`. 455 string kind = 1; 456 457 // The current serving state of the Cloud SQL instance. 458 SqlInstanceState state = 2; 459 460 // The database engine type and version. The `databaseVersion` field cannot 461 // be changed after instance creation. 462 SqlDatabaseVersion database_version = 3; 463 464 // The user settings. 465 Settings settings = 4; 466 467 // This field is deprecated and will be removed from a future version of the 468 // API. Use the `settings.settingsVersion` field instead. 469 string etag = 5; 470 471 // The name and status of the failover replica. 472 SqlFailoverReplica failover_replica = 6; 473 474 // The name of the instance which will act as primary in the replication 475 // setup. 476 string master_instance_name = 7; 477 478 // The replicas of the instance. 479 repeated string replica_names = 8; 480 481 // The maximum disk size of the instance in bytes. 482 google.protobuf.Int64Value max_disk_size = 9 [deprecated = true]; 483 484 // The current disk usage of the instance in bytes. This property has been 485 // deprecated. Use the 486 // "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud 487 // Monitoring API instead. Please see [this 488 // announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ) 489 // for details. 490 google.protobuf.Int64Value current_disk_size = 10 [deprecated = true]; 491 492 // The assigned IP addresses for the instance. 493 repeated IpMapping ip_addresses = 11; 494 495 // SSL configuration. 496 SslCert server_ca_cert = 12; 497 498 // The instance type. 499 SqlInstanceType instance_type = 13; 500 501 // The project ID of the project containing the Cloud SQL instance. The Google 502 // apps domain is prefixed if applicable. 503 string project = 14; 504 505 // The IPv6 address assigned to the instance. 506 // (Deprecated) This property was applicable only 507 // to First Generation instances. 508 string ipv6_address = 15 [deprecated = true]; 509 510 // The service account email address assigned to the instance. \This 511 // property is read-only. 512 string service_account_email_address = 16; 513 514 // Configuration specific to on-premises instances. 515 OnPremisesConfiguration on_premises_configuration = 17; 516 517 // Configuration specific to failover replicas and read replicas. 518 ReplicaConfiguration replica_configuration = 18; 519 520 // The backend type. 521 // `SECOND_GEN`: Cloud SQL database instance. 522 // `EXTERNAL`: A database server that is not managed by Google. 523 // 524 // This property is read-only; use the `tier` property in the `settings` 525 // object to determine the database type. 526 SqlBackendType backend_type = 19; 527 528 // The URI of this resource. 529 string self_link = 20; 530 531 // If the instance state is SUSPENDED, the reason for the suspension. 532 repeated SqlSuspensionReason suspension_reason = 21; 533 534 // Connection name of the Cloud SQL instance used in connection strings. 535 string connection_name = 22; 536 537 // Name of the Cloud SQL instance. This does not include the project ID. 538 string name = 23; 539 540 // The geographical region of the Cloud SQL instance. 541 // 542 // It can be one of the 543 // [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r) 544 // where Cloud SQL operates: 545 // 546 // For example, `asia-east1`, `europe-west1`, and `us-central1`. 547 // The default value is `us-central1`. 548 string region = 24; 549 550 // The Compute Engine zone that the instance is currently serving from. This 551 // value could be different from the zone that was specified when the instance 552 // was created if the instance has failed over to its secondary zone. WARNING: 553 // Changing this might restart the instance. 554 string gce_zone = 25; 555 556 // The Compute Engine zone that the failover instance is currently serving 557 // from for a regional instance. This value could be different 558 // from the zone that was specified when the instance 559 // was created if the instance has failed over to its secondary/failover zone. 560 string secondary_gce_zone = 34; 561 562 // Disk encryption configuration specific to an instance. 563 DiskEncryptionConfiguration disk_encryption_configuration = 26; 564 565 // Disk encryption status specific to an instance. 566 DiskEncryptionStatus disk_encryption_status = 27; 567 568 // Initial root password. Use only on creation. You must set root passwords 569 // before you can connect to PostgreSQL instances. 570 string root_password = 29; 571 572 // The start time of any upcoming scheduled maintenance for this instance. 573 SqlScheduledMaintenance scheduled_maintenance = 30; 574 575 // The status indicating if instance satisfiesPzs. 576 // Reserved for future use. 577 google.protobuf.BoolValue satisfies_pzs = 35; 578 579 // Output only. Stores the current database version running on the instance 580 // including minor version such as `MYSQL_8_0_18`. 581 string database_installed_version = 40 582 [(google.api.field_behavior) = OUTPUT_ONLY]; 583 584 // This field represents the report generated by the proactive database 585 // wellness job for OutOfDisk issues. 586 // * Writers: 587 // * the proactive database wellness job for OOD. 588 // * Readers: 589 // * the proactive database wellness job 590 optional SqlOutOfDiskReport out_of_disk_report = 38; 591 592 // Output only. The time when the instance was created in 593 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 594 // `2012-11-15T16:19:00.094Z`. 595 google.protobuf.Timestamp create_time = 39 596 [(google.api.field_behavior) = OUTPUT_ONLY]; 597 598 // Output only. List all maintenance versions applicable on the instance 599 repeated string available_maintenance_versions = 41 600 [(google.api.field_behavior) = OUTPUT_ONLY]; 601 602 // The current software version on the instance. 603 string maintenance_version = 42; 604 605 // The SQL network architecture for the instance. 606 optional SqlNetworkArchitecture sql_network_architecture = 47; 607 608 // Output only. The link to service attachment of PSC instance. 609 optional string psc_service_attachment_link = 48 610 [(google.api.field_behavior) = OUTPUT_ONLY]; 611 612 // Output only. The dns name of the instance. 613 optional string dns_name = 49 [(google.api.field_behavior) = OUTPUT_ONLY]; 614 615 // Output only. DEPRECATED: please use write_endpoint instead. 616 optional string primary_dns_name = 51 617 [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; 618 619 // Output only. The dns name of the primary instance in a replication group. 620 optional string write_endpoint = 52 621 [(google.api.field_behavior) = OUTPUT_ONLY]; 622} 623 624// Database list response. 625message DatabasesListResponse { 626 // This is always `sql#databasesList`. 627 string kind = 1; 628 629 // List of database resources in the instance. 630 repeated Database items = 2; 631} 632 633// Read-replica configuration for connecting to the on-premises primary 634// instance. 635message DemoteMasterConfiguration { 636 // This is always `sql#demoteMasterConfiguration`. 637 string kind = 1; 638 639 // MySQL specific configuration when replicating from a MySQL on-premises 640 // primary instance. Replication configuration information such as the 641 // username, password, certificates, and keys are not stored in the instance 642 // metadata. The configuration information is used only to set up the 643 // replication connection and is stored by MySQL in a file named 644 // `master.info` in the data directory. 645 DemoteMasterMySqlReplicaConfiguration mysql_replica_configuration = 2; 646} 647 648// Database instance demote primary instance context. 649message DemoteMasterContext { 650 // This is always `sql#demoteMasterContext`. 651 string kind = 1; 652 653 // Verify the GTID consistency for demote operation. Default value: 654 // `True`. Setting this flag to `false` enables you to bypass the GTID 655 // consistency check between on-premises primary instance and Cloud SQL 656 // instance during the demotion operation but also exposes you to the risk of 657 // future replication failures. Change the value only if you know the reason 658 // for the GTID divergence and are confident that doing so will not cause any 659 // replication issues. 660 google.protobuf.BoolValue verify_gtid_consistency = 2; 661 662 // The name of the instance which will act as on-premises primary instance 663 // in the replication setup. 664 string master_instance_name = 3; 665 666 // Configuration specific to read-replicas replicating from the on-premises 667 // primary instance. 668 DemoteMasterConfiguration replica_configuration = 4; 669 670 // Flag to skip replication setup on the instance. 671 bool skip_replication_setup = 5; 672} 673 674// Read-replica configuration specific to MySQL databases. 675message DemoteMasterMySqlReplicaConfiguration { 676 // This is always `sql#demoteMasterMysqlReplicaConfiguration`. 677 string kind = 1; 678 679 // The username for the replication connection. 680 string username = 2; 681 682 // The password for the replication connection. 683 string password = 3; 684 685 // PEM representation of the replica's private key. The corresponsing public 686 // key is encoded in the client's certificate. The format of the replica's 687 // private key can be either PKCS #1 or PKCS #8. 688 string client_key = 4; 689 690 // PEM representation of the replica's x509 certificate. 691 string client_certificate = 5; 692 693 // PEM representation of the trusted CA's x509 certificate. 694 string ca_certificate = 6; 695} 696 697// This context is used to demote an existing standalone instance to be 698// a Cloud SQL read replica for an external database server. 699message DemoteContext { 700 // This is always `sql#demoteContext`. 701 string kind = 1; 702 703 // Required. The name of the instance which acts as an on-premises primary 704 // instance in the replication setup. 705 string source_representative_instance_name = 2 706 [(google.api.field_behavior) = REQUIRED]; 707} 708 709enum SqlFileType { 710 // Unknown file type. 711 SQL_FILE_TYPE_UNSPECIFIED = 0; 712 713 // File containing SQL statements. 714 SQL = 1; 715 716 // File in CSV format. 717 CSV = 2; 718 719 BAK = 4; 720} 721 722// Database instance export context. 723message ExportContext { 724 message SqlCsvExportOptions { 725 // The select query used to extract the data. 726 string select_query = 1; 727 728 // Specifies the character that should appear before a data character that 729 // needs to be escaped. 730 string escape_character = 2; 731 732 // Specifies the quoting character to be used when a data value is quoted. 733 string quote_character = 3; 734 735 // Specifies the character that separates columns within each row (line) of 736 // the file. 737 string fields_terminated_by = 4; 738 739 // This is used to separate lines. If a line does not contain all fields, 740 // the rest of the columns are set to their default values. 741 string lines_terminated_by = 6; 742 } 743 744 message SqlExportOptions { 745 // Options for exporting from MySQL. 746 message MysqlExportOptions { 747 // Option to include SQL statement required to set up replication. If set 748 // to `1`, the dump file includes a CHANGE MASTER TO statement with the 749 // binary log coordinates, and --set-gtid-purged is set to ON. If set to 750 // `2`, the CHANGE MASTER TO statement is written as a SQL comment and 751 // has no effect. If set to any value other than `1`, --set-gtid-purged 752 // is set to OFF. 753 google.protobuf.Int32Value master_data = 1; 754 } 755 756 // Tables to export, or that were exported, from the specified database. If 757 // you specify tables, specify one and only one database. For PostgreSQL 758 // instances, you can specify only one table. 759 repeated string tables = 1; 760 761 // Export only schemas. 762 google.protobuf.BoolValue schema_only = 2; 763 764 MysqlExportOptions mysql_export_options = 3; 765 766 // Optional. The number of threads to use for parallel export. 767 google.protobuf.Int32Value threads = 4 768 [(google.api.field_behavior) = OPTIONAL]; 769 770 // Optional. Whether or not the export should be parallel. 771 google.protobuf.BoolValue parallel = 5 772 [(google.api.field_behavior) = OPTIONAL]; 773 } 774 775 // Options for exporting BAK files (SQL Server-only) 776 message SqlBakExportOptions { 777 // Whether or not the export should be striped. 778 google.protobuf.BoolValue striped = 1; 779 780 // Option for specifying how many stripes to use for the export. 781 // If blank, and the value of the striped field is true, 782 // the number of stripes is automatically chosen. 783 google.protobuf.Int32Value stripe_count = 2; 784 785 // Type of this bak file will be export, FULL or DIFF, SQL Server only 786 BakType bak_type = 4; 787 788 // Deprecated: copy_only is deprecated. Use differential_base instead 789 google.protobuf.BoolValue copy_only = 5 [deprecated = true]; 790 791 // Whether or not the backup can be used as a differential base 792 // copy_only backup can not be served as differential base 793 google.protobuf.BoolValue differential_base = 6; 794 } 795 796 // The path to the file in Google Cloud Storage where the export will be 797 // stored. The URI is in the form `gs://bucketName/fileName`. If the file 798 // already exists, the request succeeds, but the operation fails. If 799 // `fileType` is `SQL` and the filename ends with .gz, 800 // the contents are compressed. 801 string uri = 1; 802 803 // Databases to be exported. <br /> `MySQL instances:` If 804 // `fileType` is `SQL` and no database is specified, all 805 // databases are exported, except for the `mysql` system database. 806 // If `fileType` is `CSV`, you can specify one database, 807 // either by using this property or by using the 808 // `csvExportOptions.selectQuery` property, which takes precedence 809 // over this property. <br /> `PostgreSQL instances:` You must specify 810 // one database to be exported. If `fileType` is `CSV`, 811 // this database must match the one specified in the 812 // `csvExportOptions.selectQuery` property. <br /> `SQL Server 813 // instances:` You must specify one database to be exported, and the 814 // `fileType` must be `BAK`. 815 repeated string databases = 2; 816 817 // This is always `sql#exportContext`. 818 string kind = 3; 819 820 // Options for exporting data as SQL statements. 821 SqlExportOptions sql_export_options = 4; 822 823 // Options for exporting data as CSV. `MySQL` and `PostgreSQL` 824 // instances only. 825 SqlCsvExportOptions csv_export_options = 5; 826 827 // The file type for the specified uri. 828 SqlFileType file_type = 6; 829 830 // Option for export offload. 831 google.protobuf.BoolValue offload = 8; 832 833 // Options for exporting data as BAK files. 834 SqlBakExportOptions bak_export_options = 9; 835} 836 837// Database instance failover context. 838message FailoverContext { 839 // The current settings version of this instance. Request will be rejected if 840 // this version doesn't match the current settings version. 841 int64 settings_version = 1; 842 843 // This is always `sql#failoverContext`. 844 string kind = 2; 845} 846 847// A flag resource. 848message Flag { 849 // This is the name of the flag. Flag names always use underscores, not 850 // hyphens, for example: `max_allowed_packet` 851 string name = 1; 852 853 // The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`, 854 // `INTEGER` or `NONE`. `NONE` is used for flags which do not take a 855 // value, such as `skip_grant_tables`. 856 SqlFlagType type = 2; 857 858 // The database version this flag applies to. Can be 859 // MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`, 860 // or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`, 861 // `POSTGRES_11` or `POSTGRES_12`. SQL Server instances: 862 // `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`, 863 // `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`, 864 // `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or 865 // `SQLSERVER_2019_WEB`. 866 // See [the complete 867 // list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). 868 repeated SqlDatabaseVersion applies_to = 3; 869 870 // For `STRING` flags, a list of strings that the value can be set to. 871 repeated string allowed_string_values = 4; 872 873 // For `INTEGER` flags, the minimum allowed value. 874 google.protobuf.Int64Value min_value = 5; 875 876 // For `INTEGER` flags, the maximum allowed value. 877 google.protobuf.Int64Value max_value = 6; 878 879 // Indicates whether changing this flag will trigger a database restart. Only 880 // applicable to Second Generation instances. 881 google.protobuf.BoolValue requires_restart = 7; 882 883 // This is always `sql#flag`. 884 string kind = 8; 885 886 // Whether or not the flag is considered in beta. 887 google.protobuf.BoolValue in_beta = 9; 888 889 // Use this field if only certain integers are accepted. Can be combined 890 // with min_value and max_value to add additional values. 891 repeated int64 allowed_int_values = 10; 892} 893 894// Flags list response. 895message FlagsListResponse { 896 // This is always `sql#flagsList`. 897 string kind = 1; 898 899 // List of flags. 900 repeated Flag items = 2; 901} 902 903// Database instance import context. 904message ImportContext { 905 message SqlCsvImportOptions { 906 // The table to which CSV data is imported. 907 string table = 1; 908 909 // The columns to which CSV data is imported. If not specified, all columns 910 // of the database table are loaded with CSV data. 911 repeated string columns = 2; 912 913 // Specifies the character that should appear before a data character that 914 // needs to be escaped. 915 string escape_character = 4; 916 917 // Specifies the quoting character to be used when a data value is quoted. 918 string quote_character = 5; 919 920 // Specifies the character that separates columns within each row (line) of 921 // the file. 922 string fields_terminated_by = 6; 923 924 // This is used to separate lines. If a line does not contain all fields, 925 // the rest of the columns are set to their default values. 926 string lines_terminated_by = 8; 927 } 928 929 message SqlBakImportOptions { 930 message EncryptionOptions { 931 // Path to the Certificate (.cer) in Cloud Storage, in the form 932 // `gs://bucketName/fileName`. The instance must have write permissions 933 // to the bucket and read access to the file. 934 string cert_path = 1; 935 936 // Path to the Certificate Private Key (.pvk) in Cloud Storage, in the 937 // form `gs://bucketName/fileName`. The instance must have write 938 // permissions to the bucket and read access to the file. 939 string pvk_path = 2; 940 941 // Password that encrypts the private key 942 string pvk_password = 3; 943 } 944 945 EncryptionOptions encryption_options = 1; 946 947 // Whether or not the backup set being restored is striped. 948 // Applies only to Cloud SQL for SQL Server. 949 google.protobuf.BoolValue striped = 2; 950 951 // Whether or not the backup importing will restore database 952 // with NORECOVERY option 953 // Applies only to Cloud SQL for SQL Server. 954 google.protobuf.BoolValue no_recovery = 4; 955 956 // Whether or not the backup importing request will just bring database 957 // online without downloading Bak content only one of "no_recovery" and 958 // "recovery_only" can be true otherwise error will return. Applies only to 959 // Cloud SQL for SQL Server. 960 google.protobuf.BoolValue recovery_only = 5; 961 962 // Type of the bak content, FULL or DIFF. 963 BakType bak_type = 6; 964 965 // Optional. The timestamp when the import should stop. This timestamp is in 966 // the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, 967 // `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT 968 // keyword and applies to Cloud SQL for SQL Server only. 969 google.protobuf.Timestamp stop_at = 7 970 [(google.api.field_behavior) = OPTIONAL]; 971 972 // Optional. The marked transaction where the import should stop. This field 973 // is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL 974 // Server only. 975 string stop_at_mark = 8 [(google.api.field_behavior) = OPTIONAL]; 976 } 977 978 // Path to the import file in Cloud Storage, in the form 979 // `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported 980 // when `fileType` is `SQL`. The instance must have 981 // write permissions to the bucket and read access to the file. 982 string uri = 1; 983 984 // The target database for the import. If `fileType` is `SQL`, this field 985 // is required only if the import file does not specify a database, and is 986 // overridden by any database specification in the import file. If 987 // `fileType` is `CSV`, one database must be specified. 988 string database = 2; 989 990 // This is always `sql#importContext`. 991 string kind = 3; 992 993 // The file type for the specified uri. 994 // * `SQL`: The file contains SQL statements. 995 // * `CSV`: The file contains CSV data. 996 // * `BAK`: The file contains backup data for a SQL Server instance. 997 SqlFileType file_type = 4; 998 999 // Options for importing data as CSV. 1000 SqlCsvImportOptions csv_import_options = 5; 1001 1002 // The PostgreSQL user for this import operation. PostgreSQL instances only. 1003 string import_user = 6; 1004 1005 // Import parameters specific to SQL Server .BAK files 1006 SqlBakImportOptions bak_import_options = 7; 1007} 1008 1009enum BakType { 1010 // Default type. 1011 BAK_TYPE_UNSPECIFIED = 0; 1012 1013 // Full backup. 1014 FULL = 1; 1015 1016 // Differential backup. 1017 DIFF = 2; 1018 1019 // SQL Server Transaction Log 1020 TLOG = 3; 1021} 1022 1023// Database instance clone request. 1024message InstancesCloneRequest { 1025 // Contains details about the clone operation. 1026 CloneContext clone_context = 1; 1027} 1028 1029// Database demote primary instance request. 1030message InstancesDemoteMasterRequest { 1031 // Contains details about the demoteMaster operation. 1032 DemoteMasterContext demote_master_context = 1; 1033} 1034 1035// This request is used to demote an existing standalone instance to be a 1036// Cloud SQL read replica for an external database server. 1037message InstancesDemoteRequest { 1038 // Required. This context is used to demote an existing standalone instance to 1039 // be a Cloud SQL read replica for an external database server. 1040 DemoteContext demote_context = 1 [(google.api.field_behavior) = REQUIRED]; 1041} 1042 1043// Database instance export request. 1044message InstancesExportRequest { 1045 // Contains details about the export operation. 1046 ExportContext export_context = 1; 1047} 1048 1049// Instance failover request. 1050message InstancesFailoverRequest { 1051 // Failover Context. 1052 FailoverContext failover_context = 1; 1053} 1054 1055// Database instance import request. 1056message InstancesImportRequest { 1057 // Contains details about the import operation. 1058 ImportContext import_context = 1; 1059} 1060 1061// MySQL-specific external server sync settings. 1062message MySqlSyncConfig { 1063 // Flags to use for the initial dump. 1064 repeated SyncFlags initial_sync_flags = 1; 1065} 1066 1067// Database instances list response. 1068message InstancesListResponse { 1069 // This is always `sql#instancesList`. 1070 string kind = 1; 1071 1072 // List of warnings that occurred while handling the request. 1073 repeated ApiWarning warnings = 2; 1074 1075 // List of database instance resources. 1076 repeated DatabaseInstance items = 3; 1077 1078 // The continuation token, used to page through large result sets. Provide 1079 // this value in a subsequent request to return the next page of results. 1080 string next_page_token = 4; 1081} 1082 1083// Instances ListServerCas response. 1084message InstancesListServerCasResponse { 1085 // List of server CA certificates for the instance. 1086 repeated SslCert certs = 1; 1087 1088 string active_version = 2; 1089 1090 // This is always `sql#instancesListServerCas`. 1091 string kind = 3; 1092} 1093 1094// Database instance restore backup request. 1095message InstancesRestoreBackupRequest { 1096 // Parameters required to perform the restore backup operation. 1097 RestoreBackupContext restore_backup_context = 1; 1098} 1099 1100// Rotate Server CA request. 1101message InstancesRotateServerCaRequest { 1102 // Contains details about the rotate server CA operation. 1103 RotateServerCaContext rotate_server_ca_context = 1; 1104} 1105 1106// Instance truncate log request. 1107message InstancesTruncateLogRequest { 1108 // Contains details about the truncate log operation. 1109 TruncateLogContext truncate_log_context = 1; 1110} 1111 1112// Perform disk shrink context. 1113message PerformDiskShrinkContext { 1114 // The target disk shrink size in GigaBytes. 1115 int64 target_size_gb = 1; 1116} 1117 1118// Instance get disk shrink config response. 1119message SqlInstancesGetDiskShrinkConfigResponse { 1120 // This is always `sql#getDiskShrinkConfig`. 1121 string kind = 1; 1122 1123 // The minimum size to which a disk can be shrunk in GigaBytes. 1124 int64 minimal_target_size_gb = 2; 1125 1126 // Additional message to customers. 1127 string message = 3; 1128} 1129 1130// Instance verify external sync settings response. 1131message SqlInstancesVerifyExternalSyncSettingsResponse { 1132 // This is always `sql#migrationSettingErrorList`. 1133 string kind = 1; 1134 1135 // List of migration violations. 1136 repeated SqlExternalSyncSettingError errors = 2; 1137 1138 // List of migration warnings. 1139 repeated SqlExternalSyncSettingError warnings = 3; 1140} 1141 1142// External primary instance migration setting error/warning. 1143message SqlExternalSyncSettingError { 1144 enum SqlExternalSyncSettingErrorType { 1145 SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED = 0; 1146 1147 CONNECTION_FAILURE = 1; 1148 1149 BINLOG_NOT_ENABLED = 2; 1150 1151 INCOMPATIBLE_DATABASE_VERSION = 3; 1152 1153 REPLICA_ALREADY_SETUP = 4; 1154 1155 // The replication user is missing privileges that are required. 1156 INSUFFICIENT_PRIVILEGE = 5; 1157 1158 // Unsupported migration type. 1159 UNSUPPORTED_MIGRATION_TYPE = 6; 1160 1161 // No pglogical extension installed on databases, applicable for postgres. 1162 NO_PGLOGICAL_INSTALLED = 7; 1163 1164 // pglogical node already exists on databases, applicable for postgres. 1165 PGLOGICAL_NODE_ALREADY_EXISTS = 8; 1166 1167 // The value of parameter wal_level is not set to logical. 1168 INVALID_WAL_LEVEL = 9; 1169 1170 // The value of parameter shared_preload_libraries does not include 1171 // pglogical. 1172 INVALID_SHARED_PRELOAD_LIBRARY = 10; 1173 1174 // The value of parameter max_replication_slots is not sufficient. 1175 INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; 1176 1177 // The value of parameter max_wal_senders is not sufficient. 1178 INSUFFICIENT_MAX_WAL_SENDERS = 12; 1179 1180 // The value of parameter max_worker_processes is not sufficient. 1181 INSUFFICIENT_MAX_WORKER_PROCESSES = 13; 1182 1183 // Extensions installed are either not supported or having unsupported 1184 // versions 1185 UNSUPPORTED_EXTENSIONS = 14; 1186 1187 // The value of parameter rds.logical_replication is not set to 1. 1188 INVALID_RDS_LOGICAL_REPLICATION = 15; 1189 1190 // The primary instance logging setup doesn't allow EM sync. 1191 INVALID_LOGGING_SETUP = 16; 1192 1193 // The primary instance database parameter setup doesn't allow EM sync. 1194 INVALID_DB_PARAM = 17; 1195 1196 // The gtid_mode is not supported, applicable for MySQL. 1197 UNSUPPORTED_GTID_MODE = 18; 1198 1199 // SQL Server Agent is not running. 1200 SQLSERVER_AGENT_NOT_RUNNING = 19; 1201 1202 // The table definition is not support due to missing primary key or replica 1203 // identity, applicable for postgres. 1204 UNSUPPORTED_TABLE_DEFINITION = 20; 1205 1206 // The customer has a definer that will break EM setup. 1207 UNSUPPORTED_DEFINER = 21; 1208 1209 // SQL Server @@SERVERNAME does not match actual host name. 1210 SQLSERVER_SERVERNAME_MISMATCH = 22; 1211 1212 // The primary instance has been setup and will fail the setup. 1213 PRIMARY_ALREADY_SETUP = 23; 1214 1215 // The primary instance has unsupported binary log format. 1216 UNSUPPORTED_BINLOG_FORMAT = 24; 1217 1218 // The primary instance's binary log retention setting. 1219 BINLOG_RETENTION_SETTING = 25; 1220 1221 // The primary instance has tables with unsupported storage engine. 1222 UNSUPPORTED_STORAGE_ENGINE = 26; 1223 1224 // Source has tables with limited support 1225 // eg: PostgreSQL tables without primary keys. 1226 LIMITED_SUPPORT_TABLES = 27; 1227 1228 // The replica instance contains existing data. 1229 EXISTING_DATA_IN_REPLICA = 28; 1230 1231 // The replication user is missing privileges that are optional. 1232 MISSING_OPTIONAL_PRIVILEGES = 29; 1233 1234 // Additional BACKUP_ADMIN privilege is granted to the replication user 1235 // which may lock source MySQL 8 instance for DDLs during initial sync. 1236 RISKY_BACKUP_ADMIN_PRIVILEGE = 30; 1237 1238 // The Cloud Storage bucket is missing necessary permissions. 1239 INSUFFICIENT_GCS_PERMISSIONS = 31; 1240 1241 // The Cloud Storage bucket has an error in the file or contains invalid 1242 // file information. 1243 INVALID_FILE_INFO = 32; 1244 1245 // The source instance has unsupported database settings for migration. 1246 UNSUPPORTED_DATABASE_SETTINGS = 33; 1247 1248 // The replication user is missing parallel import specific privileges. 1249 // (e.g. LOCK TABLES) for MySQL. 1250 MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE = 34; 1251 1252 // The global variable local_infile is off on external server replica. 1253 LOCAL_INFILE_OFF = 35; 1254 1255 // This code instructs customers to turn on point-in-time recovery manually 1256 // for the instance after promoting the Cloud SQL for PostgreSQL instance. 1257 TURN_ON_PITR_AFTER_PROMOTE = 36; 1258 1259 // The minor version of replica database is incompatible with the source. 1260 INCOMPATIBLE_DATABASE_MINOR_VERSION = 37; 1261 1262 // This warning message indicates that Cloud SQL uses the maximum number of 1263 // subscriptions to migrate data from the source to the destination. 1264 SOURCE_MAX_SUBSCRIPTIONS = 38; 1265 1266 // Unable to verify definers on the source for MySQL. 1267 UNABLE_TO_VERIFY_DEFINERS = 39; 1268 1269 // If a time out occurs while the subscription counts are calculated, then 1270 // this value is set to 1. Otherwise, this value is set to 2. 1271 SUBSCRIPTION_CALCULATION_STATUS = 40; 1272 1273 // Count of subscriptions needed to sync source data for PostgreSQL 1274 // database. 1275 PG_SUBSCRIPTION_COUNT = 41; 1276 1277 // Final parallel level that is used to do migration. 1278 PG_SYNC_PARALLEL_LEVEL = 42; 1279 1280 // The disk size of the replica instance is smaller than the data size of 1281 // the source instance. 1282 INSUFFICIENT_DISK_SIZE = 43; 1283 1284 // The data size of the source instance is greater than 1 TB, the number of 1285 // cores of the replica instance is less than 8, and the memory of the 1286 // replica is less than 32 GB. 1287 INSUFFICIENT_MACHINE_TIER = 44; 1288 } 1289 1290 // Can be `sql#externalSyncSettingError` or 1291 // `sql#externalSyncSettingWarning`. 1292 string kind = 1; 1293 1294 // Identifies the specific error that occurred. 1295 SqlExternalSyncSettingErrorType type = 2; 1296 1297 // Additional information about the error encountered. 1298 string detail = 3; 1299} 1300 1301// IP Management configuration. 1302message IpConfiguration { 1303 // The SSL options for database connections. 1304 enum SslMode { 1305 // The SSL mode is unknown. 1306 SSL_MODE_UNSPECIFIED = 0; 1307 1308 // Allow non-SSL/non-TLS and SSL/TLS connections. For SSL/TLS connections, 1309 // the client certificate won't be verified. 1310 // When this value is used, the legacy `require_ssl` flag must be false or 1311 // cleared to avoid the conflict between values of two flags. 1312 ALLOW_UNENCRYPTED_AND_ENCRYPTED = 1; 1313 1314 // Only allow connections encrypted with SSL/TLS. 1315 // When this value is used, the legacy `require_ssl` flag must be false or 1316 // cleared to avoid the conflict between values of two flags. 1317 ENCRYPTED_ONLY = 2; 1318 1319 // Only allow connections encrypted with SSL/TLS and with valid 1320 // client certificates. 1321 // When this value is used, the legacy `require_ssl` flag must be true or 1322 // cleared to avoid the conflict between values of two flags. 1323 // PostgreSQL clients or users that connect using IAM database 1324 // authentication must use either the 1325 // [Cloud SQL Auth 1326 // Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or 1327 // [Cloud SQL 1328 // Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors) 1329 // to enforce client identity verification. 1330 TRUSTED_CLIENT_CERTIFICATE_REQUIRED = 3; 1331 } 1332 1333 // Whether the instance is assigned a public IP address or not. 1334 google.protobuf.BoolValue ipv4_enabled = 1; 1335 1336 // The resource link for the VPC network from which the Cloud SQL instance is 1337 // accessible for private IP. For example, 1338 // `/projects/myProject/global/networks/default`. This setting can 1339 // be updated, but it cannot be removed after it is set. 1340 string private_network = 2; 1341 1342 // Use `ssl_mode` instead for MySQL and PostgreSQL. SQL Server uses this flag. 1343 // 1344 // Whether SSL/TLS connections over IP are enforced. 1345 // If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections. 1346 // For SSL/TLS connections, the client certificate won't be verified. If 1347 // set to true, then only allow connections encrypted with SSL/TLS and with 1348 // valid client certificates. If you want to enforce SSL/TLS without enforcing 1349 // the requirement for valid client certificates, then use the `ssl_mode` flag 1350 // instead of the legacy `require_ssl` flag. 1351 google.protobuf.BoolValue require_ssl = 3; 1352 1353 // The list of external networks that are allowed to connect to the instance 1354 // using the IP. In 'CIDR' notation, also known as 'slash' notation (for 1355 // example: `157.197.200.0/24`). 1356 repeated AclEntry authorized_networks = 4; 1357 1358 // The name of the allocated ip range for the private ip Cloud SQL instance. 1359 // For example: "google-managed-services-default". If set, the instance ip 1360 // will be created in the allocated range. The range name must comply with 1361 // [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name 1362 // must be 1-63 characters long and match the regular expression 1363 // `[a-z]([-a-z0-9]*[a-z0-9])?.` 1364 string allocated_ip_range = 6; 1365 1366 // Controls connectivity to private IP instances from Google services, 1367 // such as BigQuery. 1368 google.protobuf.BoolValue enable_private_path_for_google_cloud_services = 7; 1369 1370 // Specify how SSL/TLS is enforced in database connections. MySQL and 1371 // PostgreSQL use the `ssl_mode` flag. If you must use the `require_ssl` flag 1372 // for backward compatibility, then only the following value pairs are valid: 1373 // 1374 // * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false` 1375 // * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false` 1376 // * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true` 1377 // 1378 // The value of `ssl_mode` gets priority over the value of `require_ssl`. For 1379 // example, for the pair `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`, 1380 // the `ssl_mode=ENCRYPTED_ONLY` means only accept SSL connections, while the 1381 // `require_ssl=false` means accept both non-SSL and SSL connections. MySQL 1382 // and PostgreSQL databases respect `ssl_mode` in this case and accept only 1383 // SSL connections. 1384 // 1385 // SQL Server uses the `require_ssl` flag. You can set the value for this flag 1386 // to `true` or `false`. 1387 SslMode ssl_mode = 8; 1388 1389 // PSC settings for this instance. 1390 optional PscConfig psc_config = 9; 1391} 1392 1393// PSC settings for a Cloud SQL instance. 1394message PscConfig { 1395 // Whether PSC connectivity is enabled for this instance. 1396 optional bool psc_enabled = 1; 1397 1398 // Optional. The list of consumer projects that are allow-listed for PSC 1399 // connections to this instance. This instance can be connected to with PSC 1400 // from any network in these projects. 1401 // 1402 // Each consumer project in this list may be represented by a project number 1403 // (numeric) or by a project id (alphanumeric). 1404 repeated string allowed_consumer_projects = 2 1405 [(google.api.field_behavior) = OPTIONAL]; 1406} 1407 1408// Database instance IP mapping 1409message IpMapping { 1410 // The type of this IP address. A `PRIMARY` address is a public address that 1411 // can accept incoming connections. A `PRIVATE` address is a private address 1412 // that can accept incoming connections. An `OUTGOING` address is the source 1413 // address of connections originating from the instance, if supported. 1414 SqlIpAddressType type = 1; 1415 1416 // The IP address assigned. 1417 string ip_address = 2; 1418 1419 // The due time for this IP to be retired in 1420 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 1421 // `2012-11-15T16:19:00.094Z`. This field is only available when 1422 // the IP is scheduled to be retired. 1423 google.protobuf.Timestamp time_to_retire = 3; 1424} 1425 1426// Preferred location. This specifies where a Cloud SQL instance is located. 1427// Note that if the preferred location is not available, the instance will be 1428// located as close as possible within the region. Only one location may be 1429// specified. 1430message LocationPreference { 1431 // The App Engine application to follow, it must be in the same region as the 1432 // Cloud SQL instance. WARNING: Changing this might restart the instance. 1433 string follow_gae_application = 1 [deprecated = true]; 1434 1435 // The preferred Compute Engine zone (for example: us-central1-a, 1436 // us-central1-b, etc.). WARNING: Changing this might restart the instance. 1437 string zone = 2; 1438 1439 // The preferred Compute Engine zone for the secondary/failover 1440 // (for example: us-central1-a, us-central1-b, etc.). 1441 // To disable this field, set it to 'no_secondary_zone'. 1442 string secondary_zone = 4; 1443 1444 // This is always `sql#locationPreference`. 1445 string kind = 3; 1446} 1447 1448// Maintenance window. This specifies when a Cloud SQL instance 1449// is restarted for system maintenance purposes. 1450message MaintenanceWindow { 1451 // hour of day - 0 to 23. 1452 google.protobuf.Int32Value hour = 1; 1453 1454 // day of week (1-7), starting on Monday. 1455 google.protobuf.Int32Value day = 2; 1456 1457 // Maintenance timing setting: `canary` (Earlier) or `stable` (Later). 1458 // [Learn 1459 // more](https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen). 1460 SqlUpdateTrack update_track = 3; 1461 1462 // This is always `sql#maintenanceWindow`. 1463 string kind = 4; 1464} 1465 1466// Deny Maintenance Periods. This specifies a date range during when all CSA 1467// rollout will be denied. 1468message DenyMaintenancePeriod { 1469 // "deny maintenance period" start date. If the year of the start date is 1470 // empty, the year of the end date also must be empty. In this case, it means 1471 // the deny maintenance period recurs every year. The date is in format 1472 // yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 1473 string start_date = 1; 1474 1475 // "deny maintenance period" end date. If the year of the end date is empty, 1476 // the year of the start date also must be empty. In this case, it means the 1477 // deny maintenance period recurs every year. The date is in format yyyy-mm-dd 1478 // i.e., 2020-11-01, or mm-dd, i.e., 11-01 1479 string end_date = 2; 1480 1481 // Time in UTC when the "deny maintenance period" starts on start_date and 1482 // ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00 1483 string time = 3; 1484} 1485 1486// Insights configuration. This specifies when Cloud SQL Insights feature is 1487// enabled and optional configuration. 1488message InsightsConfig { 1489 // Whether Query Insights feature is enabled. 1490 bool query_insights_enabled = 1; 1491 1492 // Whether Query Insights will record client address when enabled. 1493 bool record_client_address = 2; 1494 1495 // Whether Query Insights will record application tags from query when 1496 // enabled. 1497 bool record_application_tags = 3; 1498 1499 // Maximum query length stored in bytes. Default value: 1024 bytes. 1500 // Range: 256-4500 bytes. Query length more than this field value will be 1501 // truncated to this value. When unset, query length will be the default 1502 // value. Changing query length will restart the database. 1503 google.protobuf.Int32Value query_string_length = 4; 1504 1505 // Number of query execution plans captured by Insights per minute 1506 // for all queries combined. Default is 5. 1507 google.protobuf.Int32Value query_plans_per_minute = 5; 1508} 1509 1510// Read-replica configuration specific to MySQL databases. 1511message MySqlReplicaConfiguration { 1512 // Path to a SQL dump file in Google Cloud Storage from which the replica 1513 // instance is to be created. The URI is in the form gs://bucketName/fileName. 1514 // Compressed gzip files (.gz) are also supported. 1515 // Dumps have the binlog co-ordinates from which replication 1516 // begins. This can be accomplished by setting --master-data to 1 when using 1517 // mysqldump. 1518 string dump_file_path = 1; 1519 1520 // The username for the replication connection. 1521 string username = 2; 1522 1523 // The password for the replication connection. 1524 string password = 3; 1525 1526 // Seconds to wait between connect retries. MySQL's default is 60 seconds. 1527 google.protobuf.Int32Value connect_retry_interval = 4; 1528 1529 // Interval in milliseconds between replication heartbeats. 1530 google.protobuf.Int64Value master_heartbeat_period = 5; 1531 1532 // PEM representation of the trusted CA's x509 certificate. 1533 string ca_certificate = 6; 1534 1535 // PEM representation of the replica's x509 certificate. 1536 string client_certificate = 7; 1537 1538 // PEM representation of the replica's private key. The corresponsing public 1539 // key is encoded in the client's certificate. 1540 string client_key = 8; 1541 1542 // A list of permissible ciphers to use for SSL encryption. 1543 string ssl_cipher = 9; 1544 1545 // Whether or not to check the primary instance's Common Name value in the 1546 // certificate that it sends during the SSL handshake. 1547 google.protobuf.BoolValue verify_server_certificate = 10; 1548 1549 // This is always `sql#mysqlReplicaConfiguration`. 1550 string kind = 11; 1551} 1552 1553// On-premises instance configuration. 1554message OnPremisesConfiguration { 1555 // The host and port of the on-premises instance in host:port format 1556 string host_port = 1; 1557 1558 // This is always `sql#onPremisesConfiguration`. 1559 string kind = 2; 1560 1561 // The username for connecting to on-premises instance. 1562 string username = 3; 1563 1564 // The password for connecting to on-premises instance. 1565 string password = 4; 1566 1567 // PEM representation of the trusted CA's x509 certificate. 1568 string ca_certificate = 5; 1569 1570 // PEM representation of the replica's x509 certificate. 1571 string client_certificate = 6; 1572 1573 // PEM representation of the replica's private key. The corresponsing public 1574 // key is encoded in the client's certificate. 1575 string client_key = 7; 1576 1577 // The dump file to create the Cloud SQL replica. 1578 string dump_file_path = 8; 1579 1580 // The reference to Cloud SQL instance if the source is Cloud SQL. 1581 InstanceReference source_instance = 15; 1582} 1583 1584// Disk encryption configuration for an instance. 1585message DiskEncryptionConfiguration { 1586 // Resource name of KMS key for disk encryption 1587 string kms_key_name = 1; 1588 1589 // This is always `sql#diskEncryptionConfiguration`. 1590 string kind = 2; 1591} 1592 1593// Disk encryption status for an instance. 1594message DiskEncryptionStatus { 1595 // KMS key version used to encrypt the Cloud SQL instance resource 1596 string kms_key_version_name = 1; 1597 1598 // This is always `sql#diskEncryptionStatus`. 1599 string kind = 2; 1600} 1601 1602// An Operation resource. For successful operations that return an 1603// Operation resource, only the fields relevant to the operation are populated 1604// in the resource. 1605message Operation { 1606 // The type of Cloud SQL operation. 1607 enum SqlOperationType { 1608 // Unknown operation type. 1609 SQL_OPERATION_TYPE_UNSPECIFIED = 0; 1610 1611 // Imports data into a Cloud SQL instance. 1612 IMPORT = 1; 1613 1614 // Exports data from a Cloud SQL instance to a Cloud Storage 1615 // bucket. 1616 EXPORT = 2; 1617 1618 // Creates a new Cloud SQL instance. 1619 CREATE = 3; 1620 1621 // Updates the settings of a Cloud SQL instance. 1622 UPDATE = 4; 1623 1624 // Deletes a Cloud SQL instance. 1625 DELETE = 5; 1626 1627 // Restarts the Cloud SQL instance. 1628 RESTART = 6; 1629 1630 BACKUP = 7 [deprecated = true]; 1631 1632 SNAPSHOT = 8 [deprecated = true]; 1633 1634 // Performs instance backup. 1635 BACKUP_VOLUME = 9; 1636 1637 // Deletes an instance backup. 1638 DELETE_VOLUME = 10; 1639 1640 // Restores an instance backup. 1641 RESTORE_VOLUME = 11; 1642 1643 // Injects a privileged user in mysql for MOB instances. 1644 INJECT_USER = 12; 1645 1646 // Clones a Cloud SQL instance. 1647 CLONE = 14; 1648 1649 // Stops replication on a Cloud SQL read replica instance. 1650 STOP_REPLICA = 15; 1651 1652 // Starts replication on a Cloud SQL read replica instance. 1653 START_REPLICA = 16; 1654 1655 // Promotes a Cloud SQL replica instance. 1656 PROMOTE_REPLICA = 17; 1657 1658 // Creates a Cloud SQL replica instance. 1659 CREATE_REPLICA = 18; 1660 1661 // Creates a new user in a Cloud SQL instance. 1662 CREATE_USER = 19; 1663 1664 // Deletes a user from a Cloud SQL instance. 1665 DELETE_USER = 20; 1666 1667 // Updates an existing user in a Cloud SQL instance. 1668 UPDATE_USER = 21; 1669 1670 // Creates a database in the Cloud SQL instance. 1671 CREATE_DATABASE = 22; 1672 1673 // Deletes a database in the Cloud SQL instance. 1674 DELETE_DATABASE = 23; 1675 1676 // Updates a database in the Cloud SQL instance. 1677 UPDATE_DATABASE = 24; 1678 1679 // Performs failover of an HA-enabled Cloud SQL 1680 // failover replica. 1681 FAILOVER = 25; 1682 1683 // Deletes the backup taken by a backup run. 1684 DELETE_BACKUP = 26; 1685 1686 RECREATE_REPLICA = 27; 1687 1688 // Truncates a general or slow log table in MySQL. 1689 TRUNCATE_LOG = 28; 1690 1691 // Demotes the stand-alone instance to be a Cloud SQL 1692 // read replica for an external database server. 1693 DEMOTE_MASTER = 29; 1694 1695 // Indicates that the instance is currently in maintenance. Maintenance 1696 // typically causes the instance to be unavailable for 1-3 minutes. 1697 MAINTENANCE = 30; 1698 1699 // This field is deprecated, and will be removed in future version of API. 1700 ENABLE_PRIVATE_IP = 31 [deprecated = true]; 1701 1702 DEFER_MAINTENANCE = 32 [deprecated = true]; 1703 1704 // Creates clone instance. 1705 CREATE_CLONE = 33 [deprecated = true]; 1706 1707 // Reschedule maintenance to another time. 1708 RESCHEDULE_MAINTENANCE = 34; 1709 1710 // Starts external sync of a Cloud SQL EM replica to an external primary 1711 // instance. 1712 START_EXTERNAL_SYNC = 35; 1713 1714 // Recovers logs from an instance's old data disk. 1715 LOG_CLEANUP = 36; 1716 1717 // Performs auto-restart of an HA-enabled Cloud SQL database for auto 1718 // recovery. 1719 AUTO_RESTART = 37; 1720 1721 // Re-encrypts CMEK instances with latest key version. 1722 REENCRYPT = 38; 1723 1724 // Switches over to replica instance from primary. 1725 SWITCHOVER = 39; 1726 } 1727 1728 // The status of an operation. 1729 enum SqlOperationStatus { 1730 // The state of the operation is unknown. 1731 SQL_OPERATION_STATUS_UNSPECIFIED = 0; 1732 1733 // The operation has been queued, but has not started yet. 1734 PENDING = 1; 1735 1736 // The operation is running. 1737 RUNNING = 2; 1738 1739 // The operation completed. 1740 DONE = 3; 1741 } 1742 1743 // This is always `sql#operation`. 1744 string kind = 1; 1745 1746 string target_link = 2; 1747 1748 // The status of an operation. 1749 SqlOperationStatus status = 3; 1750 1751 // The email address of the user who initiated this operation. 1752 string user = 4; 1753 1754 // The time this operation was enqueued in UTC timezone in 1755 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 1756 // `2012-11-15T16:19:00.094Z`. 1757 google.protobuf.Timestamp insert_time = 5; 1758 1759 // The time this operation actually started in UTC timezone in 1760 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 1761 // `2012-11-15T16:19:00.094Z`. 1762 google.protobuf.Timestamp start_time = 6; 1763 1764 // The time this operation finished in UTC timezone in 1765 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 1766 // `2012-11-15T16:19:00.094Z`. 1767 google.protobuf.Timestamp end_time = 7; 1768 1769 // If errors occurred during processing of this operation, this field will be 1770 // populated. 1771 OperationErrors error = 8; 1772 1773 // An Admin API warning message. 1774 ApiWarning api_warning = 19; 1775 1776 // The type of the operation. Valid values are: 1777 // * `CREATE` 1778 // * `DELETE` 1779 // * `UPDATE` 1780 // * `RESTART` 1781 // * `IMPORT` 1782 // * `EXPORT` 1783 // * `BACKUP_VOLUME` 1784 // * `RESTORE_VOLUME` 1785 // * `CREATE_USER` 1786 // * `DELETE_USER` 1787 // * `CREATE_DATABASE` 1788 // * `DELETE_DATABASE` 1789 SqlOperationType operation_type = 9; 1790 1791 // The context for import operation, if applicable. 1792 ImportContext import_context = 10; 1793 1794 // The context for export operation, if applicable. 1795 ExportContext export_context = 11; 1796 1797 // The context for backup operation, if applicable. 1798 BackupContext backup_context = 17; 1799 1800 // An identifier that uniquely identifies the operation. You can use this 1801 // identifier to retrieve the Operations resource that has information about 1802 // the operation. 1803 string name = 12; 1804 1805 // Name of the database instance related to this operation. 1806 string target_id = 13; 1807 1808 // The URI of this resource. 1809 string self_link = 14; 1810 1811 // The project ID of the target instance related to this operation. 1812 string target_project = 15; 1813} 1814 1815// Database instance operation error. 1816message OperationError { 1817 // This is always `sql#operationError`. 1818 string kind = 1; 1819 1820 // Identifies the specific error that occurred. 1821 string code = 2; 1822 1823 // Additional information about the error encountered. 1824 string message = 3; 1825} 1826 1827// Database instance operation errors list wrapper. 1828message OperationErrors { 1829 // This is always `sql#operationErrors`. 1830 string kind = 1; 1831 1832 // The list of errors encountered while processing this operation. 1833 repeated OperationError errors = 2; 1834} 1835 1836// Database instance local user password validation policy 1837message PasswordValidationPolicy { 1838 // The complexity choices of the password. 1839 enum Complexity { 1840 // Complexity check is not specified. 1841 COMPLEXITY_UNSPECIFIED = 0; 1842 1843 // A combination of lowercase, uppercase, numeric, and non-alphanumeric 1844 // characters. 1845 COMPLEXITY_DEFAULT = 1; 1846 } 1847 1848 // Minimum number of characters allowed. 1849 google.protobuf.Int32Value min_length = 1; 1850 1851 // The complexity of the password. 1852 Complexity complexity = 2; 1853 1854 // Number of previous passwords that cannot be reused. 1855 google.protobuf.Int32Value reuse_interval = 3; 1856 1857 // Disallow username as a part of the password. 1858 google.protobuf.BoolValue disallow_username_substring = 4; 1859 1860 // Minimum interval after which the password can be changed. This flag is only 1861 // supported for PostgreSQL. 1862 google.protobuf.Duration password_change_interval = 5; 1863 1864 // Whether the password policy is enabled or not. 1865 google.protobuf.BoolValue enable_password_policy = 6; 1866 1867 // This field is deprecated and will be removed in a future version of the 1868 // API. 1869 google.protobuf.BoolValue disallow_compromised_credentials = 7 1870 [deprecated = true]; 1871} 1872 1873// Operations list response. 1874message OperationsListResponse { 1875 // This is always `sql#operationsList`. 1876 string kind = 1; 1877 1878 // List of operation resources. 1879 repeated Operation items = 2; 1880 1881 // The continuation token, used to page through large result sets. Provide 1882 // this value in a subsequent request to return the next page of results. 1883 string next_page_token = 3; 1884} 1885 1886// Read-replica configuration for connecting to the primary instance. 1887message ReplicaConfiguration { 1888 // This is always `sql#replicaConfiguration`. 1889 string kind = 1; 1890 1891 // MySQL specific configuration when replicating from a MySQL on-premises 1892 // primary instance. Replication configuration information such as the 1893 // username, password, certificates, and keys are not stored in the instance 1894 // metadata. The configuration information is used only to set up the 1895 // replication connection and is stored by MySQL in a file named 1896 // `master.info` in the data directory. 1897 MySqlReplicaConfiguration mysql_replica_configuration = 2; 1898 1899 // Specifies if the replica is the failover target. If the field is set to 1900 // `true` the replica will be designated as a failover replica. In case the 1901 // primary instance fails, the replica instance will be promoted as the new 1902 // primary instance. Only one replica can be specified as failover target, and 1903 // the replica has to be in different zone with the primary instance. 1904 google.protobuf.BoolValue failover_target = 3; 1905 1906 // Optional. Specifies if a SQL Server replica is a cascadable replica. A 1907 // cascadable replica is a SQL Server cross region replica that supports 1908 // replica(s) under it. 1909 google.protobuf.BoolValue cascadable_replica = 5 1910 [(google.api.field_behavior) = OPTIONAL]; 1911} 1912 1913// Database instance restore from backup context. 1914// Backup context contains source instance id and project id. 1915message RestoreBackupContext { 1916 // This is always `sql#restoreBackupContext`. 1917 string kind = 1; 1918 1919 // The ID of the backup run to restore from. 1920 int64 backup_run_id = 2; 1921 1922 // The ID of the instance that the backup was taken from. 1923 string instance_id = 3; 1924 1925 // The full project ID of the source instance. 1926 string project = 4; 1927} 1928 1929// Instance rotate server CA context. 1930message RotateServerCaContext { 1931 // This is always `sql#rotateServerCaContext`. 1932 string kind = 1; 1933 1934 // The fingerprint of the next version to be rotated to. If left unspecified, 1935 // will be rotated to the most recently added server CA version. 1936 string next_version = 2; 1937} 1938 1939// Data cache configurations. 1940message DataCacheConfig { 1941 // Whether data cache is enabled for the instance. 1942 bool data_cache_enabled = 1; 1943} 1944 1945// Database instance settings. 1946message Settings { 1947 // Specifies when the instance is activated. 1948 enum SqlActivationPolicy { 1949 // Unknown activation plan. 1950 SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; 1951 1952 // The instance is always up and running. 1953 ALWAYS = 1; 1954 1955 // The instance never starts. 1956 NEVER = 2; 1957 1958 // The instance starts upon receiving requests. 1959 ON_DEMAND = 3 [deprecated = true]; 1960 } 1961 1962 // The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS. 1963 enum Edition { 1964 // The instance did not specify the edition. 1965 EDITION_UNSPECIFIED = 0; 1966 1967 // The instance is an enterprise edition. 1968 ENTERPRISE = 2; 1969 1970 // The instance is an Enterprise Plus edition. 1971 ENTERPRISE_PLUS = 3; 1972 } 1973 1974 // The options for enforcing Cloud SQL connectors in the instance. 1975 enum ConnectorEnforcement { 1976 // The requirement for Cloud SQL connectors is unknown. 1977 CONNECTOR_ENFORCEMENT_UNSPECIFIED = 0; 1978 1979 // Do not require Cloud SQL connectors. 1980 NOT_REQUIRED = 1; 1981 1982 // Require all connections to use Cloud SQL connectors, including the 1983 // Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors. 1984 // Note: This disables all existing authorized networks. 1985 REQUIRED = 2; 1986 } 1987 1988 // The version of instance settings. This is a required field for update 1989 // method to make sure concurrent updates are handled properly. During update, 1990 // use the most recent settingsVersion value for this instance and do not try 1991 // to update this value. 1992 google.protobuf.Int64Value settings_version = 1; 1993 1994 // The App Engine app IDs that can access this instance. 1995 // (Deprecated) Applied to First Generation instances only. 1996 repeated string authorized_gae_applications = 2 [deprecated = true]; 1997 1998 // The tier (or machine type) for this instance, for example 1999 // `db-custom-1-3840`. WARNING: Changing this restarts the instance. 2000 string tier = 3; 2001 2002 // This is always `sql#settings`. 2003 string kind = 4; 2004 2005 // User-provided labels, represented as a dictionary where each label is a 2006 // single key value pair. 2007 map<string, string> user_labels = 5; 2008 2009 // Availability type. Potential values: 2010 // * `ZONAL`: The instance serves data from only one zone. Outages in that 2011 // zone affect data accessibility. 2012 // * `REGIONAL`: The instance can serve data from more than one zone in a 2013 // region (it is highly available)./ 2014 // 2015 // For more information, see [Overview of the High Availability 2016 // Configuration](https://cloud.google.com/sql/docs/mysql/high-availability). 2017 SqlAvailabilityType availability_type = 6; 2018 2019 // The pricing plan for this instance. This can be either `PER_USE` or 2020 // `PACKAGE`. Only `PER_USE` is supported for Second Generation instances. 2021 SqlPricingPlan pricing_plan = 7; 2022 2023 // The type of replication this instance uses. This can be either 2024 // `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only 2025 // applicable to First Generation instances. 2026 SqlReplicationType replication_type = 8 [deprecated = true]; 2027 2028 // The maximum size to which storage capacity can be automatically increased. 2029 // The default value is 0, which specifies that there is no limit. 2030 google.protobuf.Int64Value storage_auto_resize_limit = 9; 2031 2032 // The activation policy specifies when the instance is activated; it is 2033 // applicable only when the instance state is RUNNABLE. Valid values: 2034 // * `ALWAYS`: The instance is on, and remains so even in the absence of 2035 // connection requests. 2036 // * `NEVER`: The instance is off; it is not activated, even if a 2037 // connection request arrives. 2038 SqlActivationPolicy activation_policy = 10; 2039 2040 // The settings for IP Management. This allows to enable or disable the 2041 // instance IP and manage which external networks can connect to the instance. 2042 // The IPv4 address cannot be disabled for Second Generation instances. 2043 IpConfiguration ip_configuration = 11; 2044 2045 // Configuration to increase storage size automatically. The default value is 2046 // true. 2047 google.protobuf.BoolValue storage_auto_resize = 12; 2048 2049 // The location preference settings. This allows the instance to be located as 2050 // near as possible to either an App Engine app or Compute Engine zone for 2051 // better performance. App Engine co-location was only applicable to First 2052 // Generation instances. 2053 LocationPreference location_preference = 13; 2054 2055 // The database flags passed to the instance at startup. 2056 repeated DatabaseFlags database_flags = 14; 2057 2058 // The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for 2059 // First Generation instances. 2060 SqlDataDiskType data_disk_type = 15; 2061 2062 // The maintenance window for this instance. This specifies when the instance 2063 // can be restarted for maintenance purposes. 2064 MaintenanceWindow maintenance_window = 16; 2065 2066 // The daily backup configuration for the instance. 2067 BackupConfiguration backup_configuration = 17; 2068 2069 // Configuration specific to read replica instances. Indicates whether 2070 // replication is enabled or not. WARNING: Changing this restarts the 2071 // instance. 2072 google.protobuf.BoolValue database_replication_enabled = 18; 2073 2074 // Configuration specific to read replica instances. Indicates whether 2075 // database flags for crash-safe replication are enabled. This property was 2076 // only applicable to First Generation instances. 2077 google.protobuf.BoolValue crash_safe_replication_enabled = 19 2078 [deprecated = true]; 2079 2080 // The size of data disk, in GB. The data disk size minimum is 10GB. 2081 google.protobuf.Int64Value data_disk_size_gb = 20; 2082 2083 // Active Directory configuration, relevant only for Cloud SQL for SQL Server. 2084 SqlActiveDirectoryConfig active_directory_config = 22; 2085 2086 // The name of server Instance collation. 2087 string collation = 23; 2088 2089 // Deny maintenance periods 2090 repeated DenyMaintenancePeriod deny_maintenance_periods = 24; 2091 2092 // Insights configuration, for now relevant only for Postgres. 2093 InsightsConfig insights_config = 25; 2094 2095 // The local user password validation policy of the instance. 2096 PasswordValidationPolicy password_validation_policy = 27; 2097 2098 // SQL Server specific audit configuration. 2099 SqlServerAuditConfig sql_server_audit_config = 29; 2100 2101 // Optional. The edition of the instance. 2102 Edition edition = 38 [(google.api.field_behavior) = OPTIONAL]; 2103 2104 // Specifies if connections must use Cloud SQL connectors. 2105 // Option values include the following: `NOT_REQUIRED` (Cloud SQL instances 2106 // can be connected without Cloud SQL 2107 // Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL 2108 // Connectors) 2109 // 2110 // Note that using REQUIRED disables all existing authorized networks. If 2111 // this field is not specified when creating a new instance, NOT_REQUIRED is 2112 // used. If this field is not specified when patching or updating an existing 2113 // instance, it is left unchanged in the instance. 2114 ConnectorEnforcement connector_enforcement = 32; 2115 2116 // Configuration to protect against accidental instance deletion. 2117 google.protobuf.BoolValue deletion_protection_enabled = 33; 2118 2119 // Server timezone, relevant only for Cloud SQL for SQL Server. 2120 string time_zone = 34; 2121 2122 // Specifies advance machine configuration for the instance 2123 // relevant only for SQL Server. 2124 AdvancedMachineFeatures advanced_machine_features = 35; 2125 2126 // Configuration for data cache. 2127 DataCacheConfig data_cache_config = 37; 2128} 2129 2130// Specifies options for controlling advanced machine features. 2131message AdvancedMachineFeatures { 2132 // The number of threads per physical core. 2133 int32 threads_per_core = 1; 2134} 2135 2136// SslCerts Resource 2137message SslCert { 2138 // This is always `sql#sslCert`. 2139 string kind = 1; 2140 2141 // Serial number, as extracted from the certificate. 2142 string cert_serial_number = 2; 2143 2144 // PEM representation. 2145 string cert = 3; 2146 2147 // The time when the certificate was created in 2148 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 2149 // `2012-11-15T16:19:00.094Z`. 2150 google.protobuf.Timestamp create_time = 4; 2151 2152 // User supplied name. Constrained to [a-zA-Z.-_ ]+. 2153 string common_name = 5; 2154 2155 // The time when the certificate expires in 2156 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 2157 // `2012-11-15T16:19:00.094Z`. 2158 google.protobuf.Timestamp expiration_time = 6; 2159 2160 // Sha1 Fingerprint. 2161 string sha1_fingerprint = 7; 2162 2163 // Name of the database instance. 2164 string instance = 8; 2165 2166 // The URI of this resource. 2167 string self_link = 9; 2168} 2169 2170// SslCertDetail. 2171message SslCertDetail { 2172 // The public information about the cert. 2173 SslCert cert_info = 1; 2174 2175 // The private key for the client cert, in pem format. Keep private in order 2176 // to protect your security. 2177 string cert_private_key = 2; 2178} 2179 2180// SslCerts create ephemeral certificate request. 2181message SslCertsCreateEphemeralRequest { 2182 // PEM encoded public key to include in the signed certificate. 2183 string public_key = 1; 2184 2185 // Access token to include in the signed certificate. 2186 string access_token = 2; 2187} 2188 2189// SslCerts insert request. 2190message SslCertsInsertRequest { 2191 // User supplied name. Must be a distinct name from the other certificates 2192 // for this instance. 2193 string common_name = 1; 2194} 2195 2196// Reschedule options for maintenance windows. 2197message SqlInstancesRescheduleMaintenanceRequestBody { 2198 enum RescheduleType { 2199 RESCHEDULE_TYPE_UNSPECIFIED = 0; 2200 2201 // Reschedules maintenance to happen now (within 5 minutes). 2202 IMMEDIATE = 1; 2203 2204 // Reschedules maintenance to occur within one week from the originally 2205 // scheduled day and time. 2206 NEXT_AVAILABLE_WINDOW = 2; 2207 2208 // Reschedules maintenance to a specific time and day. 2209 SPECIFIC_TIME = 3; 2210 } 2211 2212 message Reschedule { 2213 // Required. The type of the reschedule. 2214 RescheduleType reschedule_type = 1; 2215 2216 // Optional. Timestamp when the maintenance shall be rescheduled to if 2217 // reschedule_type=SPECIFIC_TIME, in 2218 // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example 2219 // `2012-11-15T16:19:00.094Z`. 2220 google.protobuf.Timestamp schedule_time = 2 2221 [(google.api.field_behavior) = OPTIONAL]; 2222 } 2223 2224 // Required. The type of the reschedule the user wants. 2225 Reschedule reschedule = 3; 2226} 2227 2228// SslCert insert response. 2229message SslCertsInsertResponse { 2230 // This is always `sql#sslCertsInsert`. 2231 string kind = 1; 2232 2233 // The operation to track the ssl certs insert request. 2234 Operation operation = 2; 2235 2236 // The server Certificate Authority's certificate. If this is missing you can 2237 // force a new one to be generated by calling resetSslConfig method on 2238 // instances resource. 2239 SslCert server_ca_cert = 3; 2240 2241 // The new client certificate and private key. 2242 SslCertDetail client_cert = 4; 2243} 2244 2245// SslCerts list response. 2246message SslCertsListResponse { 2247 // This is always `sql#sslCertsList`. 2248 string kind = 1; 2249 2250 // List of client certificates for the instance. 2251 repeated SslCert items = 2; 2252} 2253 2254// Database Instance truncate log context. 2255message TruncateLogContext { 2256 // This is always `sql#truncateLogContext`. 2257 string kind = 1; 2258 2259 // The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and 2260 // `MYSQL_SLOW_TABLE`. 2261 string log_type = 2; 2262} 2263 2264// Active Directory configuration, relevant only for Cloud SQL for SQL Server. 2265message SqlActiveDirectoryConfig { 2266 // This is always sql#activeDirectoryConfig. 2267 string kind = 1; 2268 2269 // The name of the domain (e.g., mydomain.com). 2270 string domain = 2; 2271} 2272 2273// SQL Server specific audit configuration. 2274message SqlServerAuditConfig { 2275 // This is always sql#sqlServerAuditConfig 2276 string kind = 1; 2277 2278 // The name of the destination bucket (e.g., gs://mybucket). 2279 string bucket = 2; 2280 2281 // How long to keep generated audit files. 2282 google.protobuf.Duration retention_interval = 3; 2283 2284 // How often to upload generated audit files. 2285 google.protobuf.Duration upload_interval = 4; 2286} 2287 2288// The status of a backup run. 2289enum SqlBackupRunStatus { 2290 // The status of the run is unknown. 2291 SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0; 2292 2293 // The backup operation was enqueued. 2294 ENQUEUED = 1; 2295 2296 // The backup is overdue across a given backup window. Indicates a 2297 // problem. Example: Long-running operation in progress during 2298 // the whole window. 2299 OVERDUE = 2; 2300 2301 // The backup is in progress. 2302 RUNNING = 3; 2303 2304 // The backup failed. 2305 FAILED = 4; 2306 2307 // The backup was successful. 2308 SUCCESSFUL = 5; 2309 2310 // The backup was skipped (without problems) for a given backup 2311 // window. Example: Instance was idle. 2312 SKIPPED = 6; 2313 2314 // The backup is about to be deleted. 2315 DELETION_PENDING = 7; 2316 2317 // The backup deletion failed. 2318 DELETION_FAILED = 8; 2319 2320 // The backup has been deleted. 2321 DELETED = 9; 2322} 2323 2324enum SqlBackupRunType { 2325 // This is an unknown BackupRun type. 2326 SQL_BACKUP_RUN_TYPE_UNSPECIFIED = 0; 2327 2328 // The backup schedule automatically triggers a backup. 2329 AUTOMATED = 1; 2330 2331 // The user manually triggers a backup. 2332 ON_DEMAND = 2; 2333} 2334 2335// Defines the supported backup kinds 2336enum SqlBackupKind { 2337 // This is an unknown BackupKind. 2338 SQL_BACKUP_KIND_UNSPECIFIED = 0; 2339 2340 // The snapshot based backups 2341 SNAPSHOT = 1; 2342 2343 // Physical backups 2344 PHYSICAL = 2; 2345} 2346 2347enum SqlBackendType { 2348 // This is an unknown backend type for instance. 2349 SQL_BACKEND_TYPE_UNSPECIFIED = 0; 2350 2351 // V1 speckle instance. 2352 FIRST_GEN = 1 [deprecated = true]; 2353 2354 // V2 speckle instance. 2355 SECOND_GEN = 2; 2356 2357 // On premises instance. 2358 EXTERNAL = 3; 2359} 2360 2361enum SqlIpAddressType { 2362 // This is an unknown IP address type. 2363 SQL_IP_ADDRESS_TYPE_UNSPECIFIED = 0; 2364 2365 // IP address the customer is supposed to connect to. Usually this is the 2366 // load balancer's IP address 2367 PRIMARY = 1; 2368 2369 // Source IP address of the connection a read replica establishes to its 2370 // external primary instance. This IP address can be allowlisted by the 2371 // customer in case it has a firewall that filters incoming connection to its 2372 // on premises primary instance. 2373 OUTGOING = 2; 2374 2375 // Private IP used when using private IPs and network peering. 2376 PRIVATE = 3; 2377 2378 // V1 IP of a migrated instance. We want the user to 2379 // decommission this IP as soon as the migration is complete. 2380 // Note: V1 instances with V1 ip addresses will be counted as PRIMARY. 2381 MIGRATED_1ST_GEN = 4; 2382} 2383 2384enum SqlInstanceType { 2385 // This is an unknown Cloud SQL instance type. 2386 SQL_INSTANCE_TYPE_UNSPECIFIED = 0; 2387 2388 // A regular Cloud SQL instance that is not replicating from a primary 2389 // instance. 2390 CLOUD_SQL_INSTANCE = 1; 2391 2392 // An instance running on the customer's premises that is not managed by 2393 // Cloud SQL. 2394 ON_PREMISES_INSTANCE = 2; 2395 2396 // A Cloud SQL instance acting as a read-replica. 2397 READ_REPLICA_INSTANCE = 3; 2398} 2399 2400// The database engine type and version. 2401enum SqlDatabaseVersion { 2402 // This is an unknown database version. 2403 SQL_DATABASE_VERSION_UNSPECIFIED = 0; 2404 2405 // The database version is MySQL 5.1. 2406 MYSQL_5_1 = 2 [deprecated = true]; 2407 2408 // The database version is MySQL 5.5. 2409 MYSQL_5_5 = 3 [deprecated = true]; 2410 2411 // The database version is MySQL 5.6. 2412 MYSQL_5_6 = 5; 2413 2414 // The database version is MySQL 5.7. 2415 MYSQL_5_7 = 6; 2416 2417 // The database version is SQL Server 2017 Standard. 2418 SQLSERVER_2017_STANDARD = 11; 2419 2420 // The database version is SQL Server 2017 Enterprise. 2421 SQLSERVER_2017_ENTERPRISE = 14; 2422 2423 // The database version is SQL Server 2017 Express. 2424 SQLSERVER_2017_EXPRESS = 15; 2425 2426 // The database version is SQL Server 2017 Web. 2427 SQLSERVER_2017_WEB = 16; 2428 2429 // The database version is PostgreSQL 9.6. 2430 POSTGRES_9_6 = 9; 2431 2432 // The database version is PostgreSQL 10. 2433 POSTGRES_10 = 18; 2434 2435 // The database version is PostgreSQL 11. 2436 POSTGRES_11 = 10; 2437 2438 // The database version is PostgreSQL 12. 2439 POSTGRES_12 = 19; 2440 2441 // The database version is PostgreSQL 13. 2442 POSTGRES_13 = 23; 2443 2444 // The database version is PostgreSQL 14. 2445 POSTGRES_14 = 110; 2446 2447 // The database version is PostgreSQL 15. 2448 POSTGRES_15 = 172; 2449 2450 // The database version is MySQL 8. 2451 MYSQL_8_0 = 20; 2452 2453 // The database major version is MySQL 8.0 and the minor version is 18. 2454 MYSQL_8_0_18 = 41; 2455 2456 // The database major version is MySQL 8.0 and the minor version is 26. 2457 MYSQL_8_0_26 = 85; 2458 2459 // The database major version is MySQL 8.0 and the minor version is 27. 2460 MYSQL_8_0_27 = 111; 2461 2462 // The database major version is MySQL 8.0 and the minor version is 28. 2463 MYSQL_8_0_28 = 132; 2464 2465 // The database major version is MySQL 8.0 and the minor version is 29. 2466 MYSQL_8_0_29 = 148 [deprecated = true]; 2467 2468 // The database major version is MySQL 8.0 and the minor version is 30. 2469 MYSQL_8_0_30 = 174; 2470 2471 // The database major version is MySQL 8.0 and the minor version is 31. 2472 MYSQL_8_0_31 = 197; 2473 2474 // The database major version is MySQL 8.0 and the minor version is 32. 2475 MYSQL_8_0_32 = 213; 2476 2477 // The database major version is MySQL 8.0 and the minor version is 33. 2478 MYSQL_8_0_33 = 238; 2479 2480 // The database major version is MySQL 8.0 and the minor version is 34. 2481 MYSQL_8_0_34 = 239; 2482 2483 // The database major version is MySQL 8.0 and the minor version is 35. 2484 MYSQL_8_0_35 = 240; 2485 2486 // The database major version is MySQL 8.0 and the minor version is 36. 2487 MYSQL_8_0_36 = 241; 2488 2489 // The database version is SQL Server 2019 Standard. 2490 SQLSERVER_2019_STANDARD = 26; 2491 2492 // The database version is SQL Server 2019 Enterprise. 2493 SQLSERVER_2019_ENTERPRISE = 27; 2494 2495 // The database version is SQL Server 2019 Express. 2496 SQLSERVER_2019_EXPRESS = 28; 2497 2498 // The database version is SQL Server 2019 Web. 2499 SQLSERVER_2019_WEB = 29; 2500 2501 // The database version is SQL Server 2022 Standard. 2502 SQLSERVER_2022_STANDARD = 199; 2503 2504 // The database version is SQL Server 2022 Enterprise. 2505 SQLSERVER_2022_ENTERPRISE = 200; 2506 2507 // The database version is SQL Server 2022 Express. 2508 SQLSERVER_2022_EXPRESS = 201; 2509 2510 // The database version is SQL Server 2022 Web. 2511 SQLSERVER_2022_WEB = 202; 2512} 2513 2514// The suspension reason of the database instance if the state is SUSPENDED. 2515enum SqlSuspensionReason { 2516 // This is an unknown suspension reason. 2517 SQL_SUSPENSION_REASON_UNSPECIFIED = 0; 2518 2519 // The instance is suspended due to billing issues (for example:, GCP account 2520 // issue) 2521 BILLING_ISSUE = 2; 2522 2523 // The instance is suspended due to illegal content (for example:, child 2524 // pornography, copyrighted material, etc.). 2525 LEGAL_ISSUE = 3; 2526 2527 // The instance is causing operational issues (for example:, causing the 2528 // database to crash). 2529 OPERATIONAL_ISSUE = 4; 2530 2531 // The KMS key used by the instance is either revoked or denied access to 2532 KMS_KEY_ISSUE = 5; 2533} 2534 2535// The pricing plan for this instance. 2536enum SqlPricingPlan { 2537 // This is an unknown pricing plan for this instance. 2538 SQL_PRICING_PLAN_UNSPECIFIED = 0; 2539 2540 // The instance is billed at a monthly flat rate. 2541 PACKAGE = 1; 2542 2543 // The instance is billed per usage. 2544 PER_USE = 2; 2545} 2546 2547enum SqlReplicationType { 2548 // This is an unknown replication type for a Cloud SQL instance. 2549 SQL_REPLICATION_TYPE_UNSPECIFIED = 0; 2550 2551 // The synchronous replication mode for First Generation instances. It is the 2552 // default value. 2553 SYNCHRONOUS = 1; 2554 2555 // The asynchronous replication mode for First Generation instances. It 2556 // provides a slight performance gain, but if an outage occurs while this 2557 // option is set to asynchronous, you can lose up to a few seconds of updates 2558 // to your data. 2559 ASYNCHRONOUS = 2; 2560} 2561 2562// The type of disk that is used for a v2 instance to use. 2563enum SqlDataDiskType { 2564 // This is an unknown data disk type. 2565 SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; 2566 2567 // An SSD data disk. 2568 PD_SSD = 1; 2569 2570 // An HDD data disk. 2571 PD_HDD = 2; 2572 2573 // This field is deprecated and will be removed from a future version of the 2574 // API. 2575 OBSOLETE_LOCAL_SSD = 3 [deprecated = true]; 2576} 2577 2578// The availability type of the given Cloud SQL instance. 2579enum SqlAvailabilityType { 2580 // This is an unknown Availability type. 2581 SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0; 2582 2583 // Zonal available instance. 2584 ZONAL = 1; 2585 2586 // Regional available instance. 2587 REGIONAL = 2; 2588} 2589 2590enum SqlUpdateTrack { 2591 // This is an unknown maintenance timing preference. 2592 SQL_UPDATE_TRACK_UNSPECIFIED = 0; 2593 2594 // For instance update that requires a restart, this update track indicates 2595 // your instance prefer to restart for new version early in maintenance 2596 // window. 2597 canary = 1; 2598 2599 // For instance update that requires a restart, this update track indicates 2600 // your instance prefer to let Cloud SQL choose the timing of restart (within 2601 // its Maintenance window, if applicable). 2602 stable = 2; 2603 2604 // For instance update that requires a restart, this update track indicates 2605 // your instance prefer to let Cloud SQL choose the timing of restart (within 2606 // its Maintenance window, if applicable) to be at least 5 weeks after the 2607 // notification. 2608 week5 = 3; 2609} 2610 2611enum SqlFlagType { 2612 // This is an unknown flag type. 2613 SQL_FLAG_TYPE_UNSPECIFIED = 0; 2614 2615 // Boolean type flag. 2616 BOOLEAN = 1; 2617 2618 // String type flag. 2619 STRING = 2; 2620 2621 // Integer type flag. 2622 INTEGER = 3; 2623 2624 // Flag type used for a server startup option. 2625 NONE = 4; 2626 2627 // Type introduced specially for MySQL TimeZone offset. Accept a string value 2628 // with the format [-12:59, 13:00]. 2629 MYSQL_TIMEZONE_OFFSET = 5; 2630 2631 // Float type flag. 2632 FLOAT = 6; 2633 2634 // Comma-separated list of the strings in a SqlFlagType enum. 2635 REPEATED_STRING = 7; 2636} 2637