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/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/cloud/sql/v1beta4/cloud_sql_resources.proto"; 23import "google/protobuf/duration.proto"; 24import "google/protobuf/empty.proto"; 25import "google/protobuf/timestamp.proto"; 26 27option go_package = "cloud.google.com/go/sql/apiv1beta4/sqlpb;sqlpb"; 28option java_multiple_files = true; 29option java_outer_classname = "CloudSqlServiceProto"; 30option java_package = "com.google.cloud.sql.v1beta4"; 31 32service SqlBackupRunsService { 33 option (google.api.default_host) = "sqladmin.googleapis.com"; 34 option (google.api.oauth_scopes) = 35 "https://www.googleapis.com/auth/cloud-platform," 36 "https://www.googleapis.com/auth/sqlservice.admin"; 37 38 // Deletes the backup taken by a backup run. 39 rpc Delete(SqlBackupRunsDeleteRequest) returns (Operation) { 40 option (google.api.http) = { 41 delete: "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}" 42 }; 43 } 44 45 // Retrieves a resource containing information about a backup run. 46 rpc Get(SqlBackupRunsGetRequest) returns (BackupRun) { 47 option (google.api.http) = { 48 get: "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}" 49 }; 50 } 51 52 // Creates a new backup run on demand. 53 rpc Insert(SqlBackupRunsInsertRequest) returns (Operation) { 54 option (google.api.http) = { 55 post: "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns" 56 body: "body" 57 }; 58 } 59 60 // Lists all backup runs associated with the project or a given instance and 61 // configuration in the reverse chronological order of the backup initiation 62 // time. 63 rpc List(SqlBackupRunsListRequest) returns (BackupRunsListResponse) { 64 option (google.api.http) = { 65 get: "/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns" 66 }; 67 } 68} 69 70service SqlDatabasesService { 71 option (google.api.default_host) = "sqladmin.googleapis.com"; 72 option (google.api.oauth_scopes) = 73 "https://www.googleapis.com/auth/cloud-platform," 74 "https://www.googleapis.com/auth/sqlservice.admin"; 75 76 // Deletes a database from a Cloud SQL instance. 77 rpc Delete(SqlDatabasesDeleteRequest) returns (Operation) { 78 option (google.api.http) = { 79 delete: "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}" 80 }; 81 } 82 83 // Retrieves a resource containing information about a database inside a Cloud 84 // SQL instance. 85 rpc Get(SqlDatabasesGetRequest) returns (Database) { 86 option (google.api.http) = { 87 get: "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}" 88 }; 89 } 90 91 // Inserts a resource containing information about a database inside a Cloud 92 // SQL instance. 93 // 94 // **Note:** You can't modify the default character set and collation. 95 rpc Insert(SqlDatabasesInsertRequest) returns (Operation) { 96 option (google.api.http) = { 97 post: "/sql/v1beta4/projects/{project}/instances/{instance}/databases" 98 body: "body" 99 }; 100 } 101 102 // Lists databases in the specified Cloud SQL instance. 103 rpc List(SqlDatabasesListRequest) returns (DatabasesListResponse) { 104 option (google.api.http) = { 105 get: "/sql/v1beta4/projects/{project}/instances/{instance}/databases" 106 }; 107 } 108 109 // Partially updates a resource containing information about a database inside 110 // a Cloud SQL instance. This method supports patch semantics. 111 rpc Patch(SqlDatabasesUpdateRequest) returns (Operation) { 112 option (google.api.http) = { 113 patch: "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}" 114 body: "body" 115 }; 116 } 117 118 // Updates a resource containing information about a database inside a Cloud 119 // SQL instance. 120 rpc Update(SqlDatabasesUpdateRequest) returns (Operation) { 121 option (google.api.http) = { 122 put: "/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}" 123 body: "body" 124 }; 125 } 126} 127 128service SqlFlagsService { 129 option (google.api.default_host) = "sqladmin.googleapis.com"; 130 option (google.api.oauth_scopes) = 131 "https://www.googleapis.com/auth/cloud-platform," 132 "https://www.googleapis.com/auth/sqlservice.admin"; 133 134 // Lists all available database flags for Cloud SQL instances. 135 rpc List(SqlFlagsListRequest) returns (FlagsListResponse) { 136 option (google.api.http) = { 137 get: "/sql/v1beta4/flags" 138 }; 139 } 140} 141 142service SqlInstancesService { 143 option (google.api.default_host) = "sqladmin.googleapis.com"; 144 option (google.api.oauth_scopes) = 145 "https://www.googleapis.com/auth/cloud-platform," 146 "https://www.googleapis.com/auth/sqlservice.admin"; 147 148 // Add a new trusted Certificate Authority (CA) version for the specified 149 // instance. Required to prepare for a certificate rotation. If a CA version 150 // was previously added but never used in a certificate rotation, this 151 // operation replaces that version. There cannot be more than one CA version 152 // waiting to be rotated in. 153 rpc AddServerCa(SqlInstancesAddServerCaRequest) returns (Operation) { 154 option (google.api.http) = { 155 post: "/sql/v1beta4/projects/{project}/instances/{instance}/addServerCa" 156 }; 157 } 158 159 // Creates a Cloud SQL instance as a clone of the source instance. Using this 160 // operation might cause your instance to restart. 161 rpc Clone(SqlInstancesCloneRequest) returns (Operation) { 162 option (google.api.http) = { 163 post: "/sql/v1beta4/projects/{project}/instances/{instance}/clone" 164 body: "body" 165 }; 166 } 167 168 // Deletes a Cloud SQL instance. 169 rpc Delete(SqlInstancesDeleteRequest) returns (Operation) { 170 option (google.api.http) = { 171 delete: "/sql/v1beta4/projects/{project}/instances/{instance}" 172 }; 173 } 174 175 // Demotes the stand-alone instance to be a Cloud SQL read replica for an 176 // external database server. 177 rpc DemoteMaster(SqlInstancesDemoteMasterRequest) returns (Operation) { 178 option (google.api.http) = { 179 post: "/sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster" 180 body: "body" 181 }; 182 } 183 184 // Demotes an existing standalone instance to be a Cloud SQL read replica 185 // for an external database server. 186 rpc Demote(SqlInstancesDemoteRequest) returns (Operation) { 187 option (google.api.http) = { 188 post: "/sql/v1beta4/projects/{project}/instances/{instance}/demote" 189 body: "body" 190 }; 191 } 192 193 // Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL 194 // dump or CSV file. 195 rpc Export(SqlInstancesExportRequest) returns (Operation) { 196 option (google.api.http) = { 197 post: "/sql/v1beta4/projects/{project}/instances/{instance}/export" 198 body: "body" 199 }; 200 } 201 202 // Initiates a manual failover of a high availability (HA) primary instance 203 // to a standby instance, which becomes the primary instance. Users are 204 // then rerouted to the new primary. For more information, see the 205 // [Overview of high 206 // availability](https://cloud.google.com/sql/docs/mysql/high-availability) 207 // page in the Cloud SQL documentation. 208 // If using Legacy HA (MySQL only), this causes the instance to failover to 209 // its failover replica instance. 210 rpc Failover(SqlInstancesFailoverRequest) returns (Operation) { 211 option (google.api.http) = { 212 post: "/sql/v1beta4/projects/{project}/instances/{instance}/failover" 213 body: "body" 214 }; 215 } 216 217 // Reencrypt CMEK instance with latest key version. 218 rpc Reencrypt(SqlInstancesReencryptRequest) returns (Operation) { 219 option (google.api.http) = { 220 post: "/sql/v1beta4/projects/{project}/instances/{instance}/reencrypt" 221 body: "body" 222 }; 223 } 224 225 // Retrieves a resource containing information about a Cloud SQL instance. 226 rpc Get(SqlInstancesGetRequest) returns (DatabaseInstance) { 227 option (google.api.http) = { 228 get: "/sql/v1beta4/projects/{project}/instances/{instance}" 229 }; 230 } 231 232 // Imports data into a Cloud SQL instance from a SQL dump or CSV file in 233 // Cloud Storage. 234 rpc Import(SqlInstancesImportRequest) returns (Operation) { 235 option (google.api.http) = { 236 post: "/sql/v1beta4/projects/{project}/instances/{instance}/import" 237 body: "body" 238 }; 239 } 240 241 // Creates a new Cloud SQL instance. 242 rpc Insert(SqlInstancesInsertRequest) returns (Operation) { 243 option (google.api.http) = { 244 post: "/sql/v1beta4/projects/{project}/instances" 245 body: "body" 246 }; 247 } 248 249 // Lists instances under a given project. 250 rpc List(SqlInstancesListRequest) returns (InstancesListResponse) { 251 option (google.api.http) = { 252 get: "/sql/v1beta4/projects/{project}/instances" 253 }; 254 } 255 256 // Lists all of the trusted Certificate Authorities (CAs) for the specified 257 // instance. There can be up to three CAs listed: the CA that was used to sign 258 // the certificate that is currently in use, a CA that has been added but not 259 // yet used to sign a certificate, and a CA used to sign a certificate that 260 // has previously rotated out. 261 rpc ListServerCas(SqlInstancesListServerCasRequest) 262 returns (InstancesListServerCasResponse) { 263 option (google.api.http) = { 264 get: "/sql/v1beta4/projects/{project}/instances/{instance}/listServerCas" 265 }; 266 } 267 268 // Partially updates settings of a Cloud SQL instance by merging the request 269 // with the current configuration. This method supports patch semantics. 270 rpc Patch(SqlInstancesPatchRequest) returns (Operation) { 271 option (google.api.http) = { 272 patch: "/sql/v1beta4/projects/{project}/instances/{instance}" 273 body: "body" 274 }; 275 } 276 277 // Promotes the read replica instance to be a stand-alone Cloud SQL instance. 278 // Using this operation might cause your instance to restart. 279 rpc PromoteReplica(SqlInstancesPromoteReplicaRequest) returns (Operation) { 280 option (google.api.http) = { 281 post: "/sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica" 282 }; 283 } 284 285 // Switches over from the primary instance to a replica instance. 286 rpc Switchover(SqlInstancesSwitchoverRequest) returns (Operation) { 287 option (google.api.http) = { 288 post: "/sql/v1beta4/projects/{project}/instances/{instance}/switchover" 289 }; 290 } 291 292 // Deletes all client certificates and generates a new server SSL certificate 293 // for the instance. 294 rpc ResetSslConfig(SqlInstancesResetSslConfigRequest) returns (Operation) { 295 option (google.api.http) = { 296 post: "/sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig" 297 }; 298 } 299 300 // Restarts a Cloud SQL instance. 301 rpc Restart(SqlInstancesRestartRequest) returns (Operation) { 302 option (google.api.http) = { 303 post: "/sql/v1beta4/projects/{project}/instances/{instance}/restart" 304 }; 305 } 306 307 // Restores a backup of a Cloud SQL instance. Using this operation might cause 308 // your instance to restart. 309 rpc RestoreBackup(SqlInstancesRestoreBackupRequest) returns (Operation) { 310 option (google.api.http) = { 311 post: "/sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup" 312 body: "body" 313 }; 314 } 315 316 // Rotates the server certificate to one signed by the Certificate Authority 317 // (CA) version previously added with the addServerCA method. 318 rpc RotateServerCa(SqlInstancesRotateServerCaRequest) returns (Operation) { 319 option (google.api.http) = { 320 post: "/sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa" 321 body: "body" 322 }; 323 } 324 325 // Starts the replication in the read replica instance. 326 rpc StartReplica(SqlInstancesStartReplicaRequest) returns (Operation) { 327 option (google.api.http) = { 328 post: "/sql/v1beta4/projects/{project}/instances/{instance}/startReplica" 329 }; 330 } 331 332 // Stops the replication in the read replica instance. 333 rpc StopReplica(SqlInstancesStopReplicaRequest) returns (Operation) { 334 option (google.api.http) = { 335 post: "/sql/v1beta4/projects/{project}/instances/{instance}/stopReplica" 336 }; 337 } 338 339 // Truncate MySQL general and slow query log tables 340 // MySQL only. 341 rpc TruncateLog(SqlInstancesTruncateLogRequest) returns (Operation) { 342 option (google.api.http) = { 343 post: "/sql/v1beta4/projects/{project}/instances/{instance}/truncateLog" 344 body: "body" 345 }; 346 } 347 348 // Updates settings of a Cloud SQL instance. Using this operation might cause 349 // your instance to restart. 350 rpc Update(SqlInstancesUpdateRequest) returns (Operation) { 351 option (google.api.http) = { 352 put: "/sql/v1beta4/projects/{project}/instances/{instance}" 353 body: "body" 354 }; 355 } 356 357 // Generates a short-lived X509 certificate containing the provided public key 358 // and signed by a private key specific to the target instance. Users may use 359 // the certificate to authenticate as themselves when connecting to the 360 // database. 361 rpc CreateEphemeral(SqlInstancesCreateEphemeralCertRequest) 362 returns (SslCert) { 363 option (google.api.http) = { 364 post: "/sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral" 365 body: "body" 366 }; 367 } 368 369 // Reschedules the maintenance on the given instance. 370 rpc RescheduleMaintenance(SqlInstancesRescheduleMaintenanceRequest) 371 returns (Operation) { 372 option (google.api.http) = { 373 post: "/sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance" 374 body: "body" 375 }; 376 } 377 378 // Verify External primary instance external sync settings. 379 rpc VerifyExternalSyncSettings(SqlInstancesVerifyExternalSyncSettingsRequest) 380 returns (SqlInstancesVerifyExternalSyncSettingsResponse) { 381 option (google.api.http) = { 382 post: "/sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings" 383 body: "*" 384 }; 385 } 386 387 // Start External primary instance migration. 388 rpc StartExternalSync(SqlInstancesStartExternalSyncRequest) 389 returns (Operation) { 390 option (google.api.http) = { 391 post: "/sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync" 392 body: "*" 393 }; 394 } 395 396 // Perform Disk Shrink on primary instance. 397 rpc PerformDiskShrink(SqlInstancesPerformDiskShrinkRequest) 398 returns (Operation) { 399 option (google.api.http) = { 400 post: "/sql/v1beta4/projects/{project}/instances/{instance}/performDiskShrink" 401 body: "body" 402 }; 403 } 404 405 // Get Disk Shrink Config for a given instance. 406 rpc GetDiskShrinkConfig(SqlInstancesGetDiskShrinkConfigRequest) 407 returns (SqlInstancesGetDiskShrinkConfigResponse) { 408 option (google.api.http) = { 409 get: "/sql/v1beta4/projects/{project}/instances/{instance}/getDiskShrinkConfig" 410 }; 411 } 412 413 // Reset Replica Size to primary instance disk size. 414 rpc ResetReplicaSize(SqlInstancesResetReplicaSizeRequest) 415 returns (Operation) { 416 option (google.api.http) = { 417 post: "/sql/v1beta4/projects/{project}/instances/{instance}/resetReplicaSize" 418 body: "*" 419 }; 420 } 421 422 // Get Latest Recovery Time for a given instance. 423 rpc GetLatestRecoveryTime(SqlInstancesGetLatestRecoveryTimeRequest) 424 returns (SqlInstancesGetLatestRecoveryTimeResponse) { 425 option (google.api.http) = { 426 get: "/sql/v1beta4/projects/{project}/instances/{instance}/getLatestRecoveryTime" 427 }; 428 } 429} 430 431service SqlOperationsService { 432 option (google.api.default_host) = "sqladmin.googleapis.com"; 433 option (google.api.oauth_scopes) = 434 "https://www.googleapis.com/auth/cloud-platform," 435 "https://www.googleapis.com/auth/sqlservice.admin"; 436 437 // Retrieves an instance operation that has been performed on an instance. 438 rpc Get(SqlOperationsGetRequest) returns (Operation) { 439 option (google.api.http) = { 440 get: "/sql/v1beta4/projects/{project}/operations/{operation}" 441 }; 442 } 443 444 // Lists all instance operations that have been performed on the given Cloud 445 // SQL instance in the reverse chronological order of the start time. 446 rpc List(SqlOperationsListRequest) returns (OperationsListResponse) { 447 option (google.api.http) = { 448 get: "/sql/v1beta4/projects/{project}/operations" 449 }; 450 } 451 452 // Cancels an instance operation that has been performed on an instance. 453 rpc Cancel(SqlOperationsCancelRequest) returns (google.protobuf.Empty) { 454 option (google.api.http) = { 455 post: "/sql/v1beta4/projects/{project}/operations/{operation}/cancel" 456 }; 457 } 458} 459 460service SqlSslCertsService { 461 option (google.api.default_host) = "sqladmin.googleapis.com"; 462 option (google.api.oauth_scopes) = 463 "https://www.googleapis.com/auth/cloud-platform," 464 "https://www.googleapis.com/auth/sqlservice.admin"; 465 466 // Deletes the SSL certificate. For First Generation instances, the 467 // certificate remains valid until the instance is restarted. 468 rpc Delete(SqlSslCertsDeleteRequest) returns (Operation) { 469 option (google.api.http) = { 470 delete: "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}" 471 }; 472 } 473 474 // Retrieves a particular SSL certificate. Does not include the private key 475 // (required for usage). The private key must be saved from the response to 476 // initial creation. 477 rpc Get(SqlSslCertsGetRequest) returns (SslCert) { 478 option (google.api.http) = { 479 get: "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}" 480 }; 481 } 482 483 // Creates an SSL certificate and returns it along with the private key and 484 // server certificate authority. The new certificate will not be usable until 485 // the instance is restarted. 486 rpc Insert(SqlSslCertsInsertRequest) returns (SslCertsInsertResponse) { 487 option (google.api.http) = { 488 post: "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts" 489 body: "body" 490 }; 491 } 492 493 // Lists all of the current SSL certificates for the instance. 494 rpc List(SqlSslCertsListRequest) returns (SslCertsListResponse) { 495 option (google.api.http) = { 496 get: "/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts" 497 }; 498 } 499} 500 501message SqlBackupRunsDeleteRequest { 502 // The ID of the backup run to delete. To find a backup run ID, use the 503 // [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list) 504 // method. 505 int64 id = 1; 506 507 // Cloud SQL instance ID. This does not include the project ID. 508 string instance = 2; 509 510 // Project ID of the project that contains the instance. 511 string project = 3; 512} 513 514message SqlBackupRunsGetRequest { 515 // The ID of this backup run. 516 int64 id = 1; 517 518 // Cloud SQL instance ID. This does not include the project ID. 519 string instance = 2; 520 521 // Project ID of the project that contains the instance. 522 string project = 3; 523} 524 525message SqlBackupRunsInsertRequest { 526 // Cloud SQL instance ID. This does not include the project ID. 527 string instance = 1; 528 529 // Project ID of the project that contains the instance. 530 string project = 2; 531 532 BackupRun body = 100; 533} 534 535message SqlBackupRunsListRequest { 536 // Cloud SQL instance ID, or "-" for all instances. This does not include 537 // the project ID. 538 string instance = 1; 539 540 // Maximum number of backup runs per response. 541 int32 max_results = 2; 542 543 // A previously-returned page token representing part of the larger set of 544 // results to view. 545 string page_token = 3; 546 547 // Project ID of the project that contains the instance. 548 string project = 4; 549} 550 551message SqlDatabasesDeleteRequest { 552 // Name of the database to be deleted in the instance. 553 string database = 1; 554 555 // Database instance ID. This does not include the project ID. 556 string instance = 2; 557 558 // Project ID of the project that contains the instance. 559 string project = 3; 560} 561 562message SqlDatabasesGetRequest { 563 // Name of the database in the instance. 564 string database = 1; 565 566 // Database instance ID. This does not include the project ID. 567 string instance = 2; 568 569 // Project ID of the project that contains the instance. 570 string project = 3; 571} 572 573message SqlDatabasesInsertRequest { 574 // Database instance ID. This does not include the project ID. 575 string instance = 1; 576 577 // Project ID of the project that contains the instance. 578 string project = 2; 579 580 Database body = 100; 581} 582 583message SqlDatabasesListRequest { 584 // Cloud SQL instance ID. This does not include the project ID. 585 string instance = 1; 586 587 // Project ID of the project that contains the instance. 588 string project = 2; 589} 590 591message SqlDatabasesUpdateRequest { 592 // Name of the database to be updated in the instance. 593 string database = 1; 594 595 // Database instance ID. This does not include the project ID. 596 string instance = 2; 597 598 // Project ID of the project that contains the instance. 599 string project = 3; 600 601 Database body = 100; 602} 603 604message SqlFlagsListRequest { 605 // Database type and version you want to retrieve flags for. By default, this 606 // method returns flags for all database types and versions. 607 string database_version = 1; 608} 609 610message SqlInstancesAddServerCaRequest { 611 // Cloud SQL instance ID. This does not include the project ID. 612 string instance = 1; 613 614 // Project ID of the project that contains the instance. 615 string project = 2; 616} 617 618message SqlInstancesCloneRequest { 619 // The ID of the Cloud SQL instance to be cloned (source). This does not 620 // include the project ID. 621 string instance = 1; 622 623 // Project ID of the source as well as the clone Cloud SQL instance. 624 string project = 2; 625 626 InstancesCloneRequest body = 100; 627} 628 629message SqlInstancesDeleteRequest { 630 // Cloud SQL instance ID. This does not include the project ID. 631 string instance = 1; 632 633 // Project ID of the project that contains the instance to be deleted. 634 string project = 2; 635} 636 637message SqlInstancesDemoteMasterRequest { 638 // Cloud SQL instance name. 639 string instance = 1; 640 641 // ID of the project that contains the instance. 642 string project = 2; 643 644 InstancesDemoteMasterRequest body = 100; 645} 646 647// Instance demote request. 648message SqlInstancesDemoteRequest { 649 // Required. The name of the Cloud SQL instance. 650 string instance = 1 [(google.api.field_behavior) = REQUIRED]; 651 652 // Required. The project ID of the project that contains the instance. 653 string project = 2 [(google.api.field_behavior) = REQUIRED]; 654 655 // The request body. 656 InstancesDemoteRequest body = 100; 657} 658 659message SqlInstancesExportRequest { 660 // The Cloud SQL instance ID. This doesn't include the project ID. 661 string instance = 1; 662 663 // Project ID of the project that contains the instance to be exported. 664 string project = 2; 665 666 InstancesExportRequest body = 100; 667} 668 669message SqlInstancesFailoverRequest { 670 // Cloud SQL instance ID. This does not include the project ID. 671 string instance = 1; 672 673 // ID of the project that contains the read replica. 674 string project = 2; 675 676 InstancesFailoverRequest body = 100; 677} 678 679message SqlInstancesGetRequest { 680 // Database instance ID. This does not include the project ID. 681 string instance = 1; 682 683 // Project ID of the project that contains the instance. 684 string project = 2; 685} 686 687message SqlInstancesImportRequest { 688 // Cloud SQL instance ID. This does not include the project ID. 689 string instance = 1; 690 691 // Project ID of the project that contains the instance. 692 string project = 2; 693 694 InstancesImportRequest body = 100; 695} 696 697message SqlInstancesInsertRequest { 698 // Project ID of the project to which the newly created Cloud SQL instances 699 // should belong. 700 string project = 1; 701 702 DatabaseInstance body = 100; 703} 704 705message SqlInstancesListRequest { 706 // A filter expression that filters resources listed in the response. 707 // The expression is in the form of field:value. For example, 708 // 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per 709 // their JSON representation, such as 'settings.userLabels.auto_start:true'. 710 // 711 // Multiple filter queries are space-separated. For example. 712 // 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each 713 // expression is an AND expression. However, you can include AND and OR 714 // expressions explicitly. 715 string filter = 1; 716 717 // The maximum number of instances to return. The service may return fewer 718 // than this value. 719 // If unspecified, at most 500 instances are returned. 720 // The maximum value is 1000; values above 1000 are coerced to 1000. 721 uint32 max_results = 2; 722 723 // A previously-returned page token representing part of the larger set of 724 // results to view. 725 string page_token = 3; 726 727 // Project ID of the project for which to list Cloud SQL instances. 728 string project = 4; 729} 730 731message SqlInstancesListServerCasRequest { 732 // Cloud SQL instance ID. This does not include the project ID. 733 string instance = 1; 734 735 // Project ID of the project that contains the instance. 736 string project = 2; 737} 738 739message SqlInstancesPatchRequest { 740 // Cloud SQL instance ID. This does not include the project ID. 741 string instance = 1; 742 743 // Project ID of the project that contains the instance. 744 string project = 2; 745 746 DatabaseInstance body = 100; 747} 748 749message SqlInstancesPromoteReplicaRequest { 750 // Cloud SQL read replica instance name. 751 string instance = 1; 752 753 // ID of the project that contains the read replica. 754 string project = 2; 755 756 // Set to true if the promote operation should attempt to re-add the original 757 // primary as a replica when it comes back online. Otherwise, if this value is 758 // false or not set, the original primary will be a standalone instance. 759 bool failover = 3; 760} 761 762// Instance switchover request. 763message SqlInstancesSwitchoverRequest { 764 // Cloud SQL read replica instance name. 765 string instance = 1; 766 767 // ID of the project that contains the replica. 768 string project = 2; 769 770 // Optional. (MySQL only) Cloud SQL instance operations timeout, which is a 771 // sum of all database operations. Default value is 10 minutes and can be 772 // modified to a maximum value of 24 hours. 773 google.protobuf.Duration db_timeout = 3 774 [(google.api.field_behavior) = OPTIONAL]; 775} 776 777message SqlInstancesResetSslConfigRequest { 778 // Cloud SQL instance ID. This does not include the project ID. 779 string instance = 1; 780 781 // Project ID of the project that contains the instance. 782 string project = 2; 783} 784 785message SqlInstancesRestartRequest { 786 // Cloud SQL instance ID. This does not include the project ID. 787 string instance = 1; 788 789 // Project ID of the project that contains the instance to be restarted. 790 string project = 2; 791} 792 793message SqlInstancesRestoreBackupRequest { 794 // Cloud SQL instance ID. This does not include the project ID. 795 string instance = 1; 796 797 // Project ID of the project that contains the instance. 798 string project = 2; 799 800 InstancesRestoreBackupRequest body = 100; 801} 802 803message SqlInstancesRotateServerCaRequest { 804 // Cloud SQL instance ID. This does not include the project ID. 805 string instance = 1; 806 807 // Project ID of the project that contains the instance. 808 string project = 2; 809 810 InstancesRotateServerCaRequest body = 100; 811} 812 813message SqlInstancesStartReplicaRequest { 814 // Cloud SQL read replica instance name. 815 string instance = 1; 816 817 // ID of the project that contains the read replica. 818 string project = 2; 819} 820 821message SqlInstancesStopReplicaRequest { 822 // Cloud SQL read replica instance name. 823 string instance = 1; 824 825 // ID of the project that contains the read replica. 826 string project = 2; 827} 828 829message SqlInstancesTruncateLogRequest { 830 // Cloud SQL instance ID. This does not include the project ID. 831 string instance = 1; 832 833 // Project ID of the Cloud SQL project. 834 string project = 2; 835 836 InstancesTruncateLogRequest body = 100; 837} 838 839message SqlInstancesUpdateRequest { 840 // Cloud SQL instance ID. This does not include the project ID. 841 string instance = 1; 842 843 // Project ID of the project that contains the instance. 844 string project = 2; 845 846 DatabaseInstance body = 100; 847} 848 849// Instance reencrypt request. 850message SqlInstancesReencryptRequest { 851 // Cloud SQL instance ID. This does not include the project ID. 852 string instance = 1; 853 854 // ID of the project that contains the instance. 855 string project = 2; 856 857 // Reencrypt body that users request 858 InstancesReencryptRequest body = 3; 859} 860 861// Database Instance reencrypt request. 862message InstancesReencryptRequest { 863 // Configuration specific to backup re-encryption 864 optional BackupReencryptionConfig backup_reencryption_config = 1; 865} 866 867// Backup Reencryption Config 868message BackupReencryptionConfig { 869 // Backup type for re-encryption 870 enum BackupType { 871 // Unknown backup type, will be defaulted to AUTOMATIC backup type 872 BACKUP_TYPE_UNSPECIFIED = 0; 873 874 // Reencrypt automatic backups 875 AUTOMATED = 1; 876 877 // Reencrypt on-demand backups 878 ON_DEMAND = 2; 879 } 880 881 // Backup re-encryption limit 882 optional int32 backup_limit = 1; 883 884 // Type of backups users want to re-encrypt. 885 optional BackupType backup_type = 2; 886} 887 888message SqlInstancesRescheduleMaintenanceRequest { 889 // Cloud SQL instance ID. This does not include the project ID. 890 string instance = 1; 891 892 // ID of the project that contains the instance. 893 string project = 2; 894 895 SqlInstancesRescheduleMaintenanceRequestBody body = 100; 896} 897 898// Instance perform disk shrink request. 899message SqlInstancesPerformDiskShrinkRequest { 900 // Cloud SQL instance ID. This does not include the project ID. 901 string instance = 1; 902 903 // Project ID of the project that contains the instance. 904 string project = 2; 905 906 // Perform disk shrink context. 907 PerformDiskShrinkContext body = 100; 908} 909 910// External Sync parallel level. 911enum ExternalSyncParallelLevel { 912 // Unknown sync parallel level. Will be defaulted to OPTIMAL. 913 EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED = 0; 914 915 // Minimal parallel level. 916 MIN = 1; 917 918 // Optimal parallel level. 919 OPTIMAL = 2; 920 921 // Maximum parallel level. 922 MAX = 3; 923} 924 925message SqlInstancesVerifyExternalSyncSettingsRequest { 926 enum ExternalSyncMode { 927 // Unknown external sync mode, will be defaulted to ONLINE mode 928 EXTERNAL_SYNC_MODE_UNSPECIFIED = 0; 929 930 // Online external sync will set up replication after initial data external 931 // sync 932 ONLINE = 1; 933 934 // Offline external sync only dumps and loads a one-time snapshot of 935 // the primary instance's data 936 OFFLINE = 2; 937 } 938 939 // Cloud SQL instance ID. This does not include the project ID. 940 string instance = 1; 941 942 // Project ID of the project that contains the instance. 943 string project = 2; 944 945 // Flag to enable verifying connection only 946 bool verify_connection_only = 3; 947 948 // External sync mode 949 ExternalSyncMode sync_mode = 4; 950 951 // Optional. Flag to verify settings required by replication setup only 952 bool verify_replication_only = 5 [(google.api.field_behavior) = OPTIONAL]; 953 954 oneof sync_config { 955 // Optional. MySQL-specific settings for start external sync. 956 MySqlSyncConfig mysql_sync_config = 6 957 [(google.api.field_behavior) = OPTIONAL]; 958 } 959} 960 961message SqlInstancesStartExternalSyncRequest { 962 // Cloud SQL instance ID. This does not include the project ID. 963 string instance = 1; 964 965 // ID of the project that contains the instance. 966 string project = 2; 967 968 // External sync mode. 969 SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode sync_mode = 3; 970 971 // Whether to skip the verification step (VESS). 972 bool skip_verification = 4; 973 974 oneof sync_config { 975 // MySQL-specific settings for start external sync. 976 MySqlSyncConfig mysql_sync_config = 6; 977 } 978 979 // Optional. Parallel level for initial data sync. Currently only applicable 980 // for MySQL. 981 ExternalSyncParallelLevel sync_parallel_level = 7 982 [(google.api.field_behavior) = OPTIONAL]; 983} 984 985// Instance reset replica size request. 986message SqlInstancesResetReplicaSizeRequest { 987 // Cloud SQL read replica instance name. 988 string instance = 1; 989 990 // ID of the project that contains the read replica. 991 string project = 2; 992} 993 994message SqlOperationsGetRequest { 995 // Instance operation ID. 996 string operation = 1; 997 998 // Project ID of the project that contains the instance. 999 string project = 2; 1000} 1001 1002message SqlOperationsListRequest { 1003 // Cloud SQL instance ID. This does not include the project ID. 1004 string instance = 1; 1005 1006 // Maximum number of operations per response. 1007 uint32 max_results = 2; 1008 1009 // A previously-returned page token representing part of the larger set of 1010 // results to view. 1011 string page_token = 3; 1012 1013 // Project ID of the project that contains the instance. 1014 string project = 4; 1015} 1016 1017// The request payload to cancel an operation. 1018message SqlOperationsCancelRequest { 1019 // Instance operation ID. 1020 string operation = 1; 1021 1022 // Project ID of the project that contains the instance. 1023 string project = 2; 1024} 1025 1026message SqlInstancesCreateEphemeralCertRequest { 1027 // Cloud SQL instance ID. This does not include the project ID. 1028 string instance = 1; 1029 1030 // Project ID of the Cloud SQL project. 1031 string project = 2; 1032 1033 SslCertsCreateEphemeralRequest body = 100; 1034} 1035 1036message SqlSslCertsDeleteRequest { 1037 // Cloud SQL instance ID. This does not include the project ID. 1038 string instance = 1; 1039 1040 // Project ID of the project that contains the instance. 1041 string project = 2; 1042 1043 // Sha1 FingerPrint. 1044 string sha1_fingerprint = 3; 1045} 1046 1047message SqlSslCertsGetRequest { 1048 // Cloud SQL instance ID. This does not include the project ID. 1049 string instance = 1; 1050 1051 // Project ID of the project that contains the instance. 1052 string project = 2; 1053 1054 // Sha1 FingerPrint. 1055 string sha1_fingerprint = 3; 1056} 1057 1058message SqlSslCertsInsertRequest { 1059 // Cloud SQL instance ID. This does not include the project ID. 1060 string instance = 1; 1061 1062 // Project ID of the project that contains the instance. 1063 string project = 2; 1064 1065 SslCertsInsertRequest body = 100; 1066} 1067 1068message SqlSslCertsListRequest { 1069 // Cloud SQL instance ID. This does not include the project ID. 1070 string instance = 1; 1071 1072 // Project ID of the project that contains the instance. 1073 string project = 2; 1074} 1075 1076// Instance get disk shrink config request. 1077message SqlInstancesGetDiskShrinkConfigRequest { 1078 // Cloud SQL instance ID. This does not include the project ID. 1079 string instance = 1; 1080 1081 // Project ID of the project that contains the instance. 1082 string project = 2; 1083} 1084 1085// Instance get latest recovery time request. 1086message SqlInstancesGetLatestRecoveryTimeRequest { 1087 // Cloud SQL instance ID. This does not include the project ID. 1088 string instance = 1; 1089 1090 // Project ID of the project that contains the instance. 1091 string project = 2; 1092} 1093 1094// Instance get latest recovery time response. 1095message SqlInstancesGetLatestRecoveryTimeResponse { 1096 // This is always `sql#getLatestRecoveryTime`. 1097 string kind = 1; 1098 1099 // Timestamp, identifies the latest recovery time of the source instance. 1100 google.protobuf.Timestamp latest_recovery_time = 2; 1101} 1102