1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.sql.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/cloud/sql/v1/cloud_sql_resources.proto"; 23import "google/protobuf/empty.proto"; 24 25option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb"; 26option java_multiple_files = true; 27option java_outer_classname = "CloudSqlOperationsProto"; 28option java_package = "com.google.cloud.sql.v1"; 29 30// LINT: LEGACY_NAMES 31 32// Service to fetch operations for database instances. 33service SqlOperationsService { 34 option (google.api.default_host) = "sqladmin.googleapis.com"; 35 option (google.api.oauth_scopes) = 36 "https://www.googleapis.com/auth/cloud-platform," 37 "https://www.googleapis.com/auth/sqlservice.admin"; 38 39 // Retrieves an instance operation that has been performed on an instance. 40 rpc Get(SqlOperationsGetRequest) returns (Operation) { 41 option (google.api.http) = { 42 get: "/v1/projects/{project}/operations/{operation}" 43 }; 44 } 45 46 // Lists all instance operations that have been performed on the given Cloud 47 // SQL instance in the reverse chronological order of the start time. 48 rpc List(SqlOperationsListRequest) returns (OperationsListResponse) { 49 option (google.api.http) = { 50 get: "/v1/projects/{project}/operations" 51 }; 52 } 53 54 // Cancels an instance operation that has been performed on an instance. 55 rpc Cancel(SqlOperationsCancelRequest) returns (google.protobuf.Empty) { 56 option (google.api.http) = { 57 post: "/v1/projects/{project}/operations/{operation}/cancel" 58 }; 59 } 60} 61 62// Operations get request. 63message SqlOperationsGetRequest { 64 // Instance operation ID. 65 string operation = 1; 66 67 // Project ID of the project that contains the instance. 68 string project = 2; 69} 70 71// Operations list request. 72message SqlOperationsListRequest { 73 // Cloud SQL instance ID. This does not include the project ID. 74 string instance = 1; 75 76 // Maximum number of operations per response. 77 uint32 max_results = 2; 78 79 // A previously-returned page token representing part of the larger set of 80 // results to view. 81 string page_token = 3; 82 83 // Project ID of the project that contains the instance. 84 string project = 4; 85} 86 87// Operations list response. 88message OperationsListResponse { 89 // This is always `sql#operationsList`. 90 string kind = 1; 91 92 // List of operation resources. 93 repeated Operation items = 2; 94 95 // The continuation token, used to page through large result sets. Provide 96 // this value in a subsequent request to return the next page of results. 97 string next_page_token = 3; 98} 99 100// Operations cancel request. 101message SqlOperationsCancelRequest { 102 // Instance operation ID. 103 string operation = 1; 104 105 // Project ID of the project that contains the instance. 106 string project = 2; 107} 108