cloud_sql_databases.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.cloud.sql.v1;
  16. import "google/api/annotations.proto";
  17. import "google/cloud/sql/v1/cloud_sql_resources.proto";
  18. import "google/api/client.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/cloud/sql/v1;sql";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "CloudSqlDatabasesProto";
  22. option java_package = "com.google.cloud.sql.v1";
  23. // LINT: LEGACY_NAMES
  24. // Service to manage databases.
  25. service SqlDatabasesService {
  26. option (google.api.default_host) = "sqladmin.googleapis.com";
  27. option (google.api.oauth_scopes) =
  28. "https://www.googleapis.com/auth/cloud-platform,"
  29. "https://www.googleapis.com/auth/sqlservice.admin";
  30. // Deletes a database from a Cloud SQL instance.
  31. rpc Delete(SqlDatabasesDeleteRequest) returns (Operation) {
  32. option (google.api.http) = {
  33. delete: "/v1/projects/{project}/instances/{instance}/databases/{database}"
  34. };
  35. }
  36. // Retrieves a resource containing information about a database inside a Cloud
  37. // SQL instance.
  38. rpc Get(SqlDatabasesGetRequest) returns (Database) {
  39. option (google.api.http) = {
  40. get: "/v1/projects/{project}/instances/{instance}/databases/{database}"
  41. };
  42. }
  43. // Inserts a resource containing information about a database inside a Cloud
  44. // SQL instance.
  45. rpc Insert(SqlDatabasesInsertRequest) returns (Operation) {
  46. option (google.api.http) = {
  47. post: "/v1/projects/{project}/instances/{instance}/databases"
  48. body: "body"
  49. };
  50. }
  51. // Lists databases in the specified Cloud SQL instance.
  52. rpc List(SqlDatabasesListRequest) returns (DatabasesListResponse) {
  53. option (google.api.http) = {
  54. get: "/v1/projects/{project}/instances/{instance}/databases"
  55. };
  56. }
  57. // Partially updates a resource containing information about a database inside
  58. // a Cloud SQL instance. This method supports patch semantics.
  59. rpc Patch(SqlDatabasesUpdateRequest) returns (Operation) {
  60. option (google.api.http) = {
  61. patch: "/v1/projects/{project}/instances/{instance}/databases/{database}"
  62. body: "body"
  63. };
  64. }
  65. // Updates a resource containing information about a database inside a Cloud
  66. // SQL instance.
  67. rpc Update(SqlDatabasesUpdateRequest) returns (Operation) {
  68. option (google.api.http) = {
  69. put: "/v1/projects/{project}/instances/{instance}/databases/{database}"
  70. body: "body"
  71. };
  72. }
  73. }
  74. // Database delete request.
  75. message SqlDatabasesDeleteRequest {
  76. // Name of the database to be deleted in the instance.
  77. string database = 1;
  78. // Database instance ID. This does not include the project ID.
  79. string instance = 2;
  80. // Project ID of the project that contains the instance.
  81. string project = 3;
  82. }
  83. // Database get request.
  84. message SqlDatabasesGetRequest {
  85. // Name of the database in the instance.
  86. string database = 1;
  87. // Database instance ID. This does not include the project ID.
  88. string instance = 2;
  89. // Project ID of the project that contains the instance.
  90. string project = 3;
  91. }
  92. // Database insert request.
  93. message SqlDatabasesInsertRequest {
  94. // Database instance ID. This does not include the project ID.
  95. string instance = 1;
  96. // Project ID of the project that contains the instance.
  97. string project = 2;
  98. Database body = 100;
  99. }
  100. // Database list request.
  101. message SqlDatabasesListRequest {
  102. // Cloud SQL instance ID. This does not include the project ID.
  103. string instance = 1;
  104. // Project ID of the project that contains the instance.
  105. string project = 2;
  106. }
  107. // Database update request.
  108. message SqlDatabasesUpdateRequest {
  109. // Name of the database to be updated in the instance.
  110. string database = 1;
  111. // Database instance ID. This does not include the project ID.
  112. string instance = 2;
  113. // Project ID of the project that contains the instance.
  114. string project = 3;
  115. Database body = 100;
  116. }
  117. // Database list response.
  118. message DatabasesListResponse {
  119. // This is always **sql#databasesList**.
  120. string kind = 1;
  121. // List of database resources in the instance.
  122. repeated Database items = 2;
  123. }