cloud_sql_backup_runs.proto 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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/protobuf/timestamp.proto";
  19. import "google/api/client.proto";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/sql/v1;sql";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "CloudSqlBackupRunsProto";
  23. option java_package = "com.google.cloud.sql.v1";
  24. // LINT: LEGACY_NAMES
  25. // Service for managing database backups.
  26. service SqlBackupRunsService {
  27. option (google.api.default_host) = "sqladmin.googleapis.com";
  28. option (google.api.oauth_scopes) =
  29. "https://www.googleapis.com/auth/cloud-platform,"
  30. "https://www.googleapis.com/auth/sqlservice.admin";
  31. // Deletes the backup taken by a backup run.
  32. rpc Delete(SqlBackupRunsDeleteRequest) returns (Operation) {
  33. option (google.api.http) = {
  34. delete: "/v1/projects/{project}/instances/{instance}/backupRuns/{id}"
  35. };
  36. }
  37. // Retrieves a resource containing information about a backup run.
  38. rpc Get(SqlBackupRunsGetRequest) returns (BackupRun) {
  39. option (google.api.http) = {
  40. get: "/v1/projects/{project}/instances/{instance}/backupRuns/{id}"
  41. };
  42. }
  43. // Creates a new backup run on demand.
  44. rpc Insert(SqlBackupRunsInsertRequest) returns (Operation) {
  45. option (google.api.http) = {
  46. post: "/v1/projects/{project}/instances/{instance}/backupRuns"
  47. body: "body"
  48. };
  49. }
  50. // Lists all backup runs associated with the project or a given instance
  51. // and configuration in the reverse chronological order of the backup
  52. // initiation time.
  53. rpc List(SqlBackupRunsListRequest) returns (BackupRunsListResponse) {
  54. option (google.api.http) = {
  55. get: "/v1/projects/{project}/instances/{instance}/backupRuns"
  56. };
  57. }
  58. }
  59. // Backup runs delete request.
  60. message SqlBackupRunsDeleteRequest {
  61. // The ID of the backup run to delete. To find a backup run ID, use the
  62. // [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
  63. // method.
  64. int64 id = 1;
  65. // Cloud SQL instance ID. This does not include the project ID.
  66. string instance = 2;
  67. // Project ID of the project that contains the instance.
  68. string project = 3;
  69. }
  70. // Backup runs get request.
  71. message SqlBackupRunsGetRequest {
  72. // The ID of this backup run.
  73. int64 id = 1;
  74. // Cloud SQL instance ID. This does not include the project ID.
  75. string instance = 2;
  76. // Project ID of the project that contains the instance.
  77. string project = 3;
  78. }
  79. // Backup runs insert request.
  80. message SqlBackupRunsInsertRequest {
  81. // Cloud SQL instance ID. This does not include the project ID.
  82. string instance = 1;
  83. // Project ID of the project that contains the instance.
  84. string project = 2;
  85. BackupRun body = 100;
  86. }
  87. // Backup runs list request.
  88. message SqlBackupRunsListRequest {
  89. // Cloud SQL instance ID, or "-" for all instances. This does not include
  90. // the project ID.
  91. string instance = 1;
  92. // Maximum number of backup runs per response.
  93. int32 max_results = 2;
  94. // A previously-returned page token representing part of the larger set of
  95. // results to view.
  96. string page_token = 3;
  97. // Project ID of the project that contains the instance.
  98. string project = 4;
  99. }
  100. // A BackupRun resource.
  101. message BackupRun {
  102. // This is always **sql#backupRun**.
  103. string kind = 1;
  104. // The status of this run.
  105. SqlBackupRunStatus status = 2;
  106. // The time the run was enqueued in UTC timezone in
  107. // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
  108. // **2012-11-15T16:19:00.094Z**.
  109. google.protobuf.Timestamp enqueued_time = 3;
  110. // The identifier for this backup run. Unique only for a specific Cloud SQL
  111. // instance.
  112. int64 id = 4;
  113. // The time the backup operation actually started in UTC timezone in
  114. // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
  115. // **2012-11-15T16:19:00.094Z**.
  116. google.protobuf.Timestamp start_time = 5;
  117. // The time the backup operation completed in UTC timezone in
  118. // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
  119. // **2012-11-15T16:19:00.094Z**.
  120. google.protobuf.Timestamp end_time = 6;
  121. // Information about why the backup operation failed. This is only present if
  122. // the run has the FAILED status.
  123. OperationError error = 7;
  124. // The type of this run; can be either "AUTOMATED" or "ON_DEMAND". This field
  125. // defaults to "ON_DEMAND" and is ignored, when specified for insert requests.
  126. SqlBackupRunType type = 8;
  127. // The description of this run, only applicable to on-demand backups.
  128. string description = 9;
  129. // The start time of the backup window during which this the backup was
  130. // attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
  131. // example **2012-11-15T16:19:00.094Z**.
  132. google.protobuf.Timestamp window_start_time = 10;
  133. // Name of the database instance.
  134. string instance = 11;
  135. // The URI of this resource.
  136. string self_link = 12;
  137. // Location of the backups.
  138. string location = 13;
  139. // Encryption configuration specific to a backup.
  140. DiskEncryptionConfiguration disk_encryption_configuration = 16;
  141. // Encryption status specific to a backup.
  142. DiskEncryptionStatus disk_encryption_status = 17;
  143. // Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
  144. SqlBackupKind backup_kind = 19;
  145. }
  146. // Backup run list results.
  147. message BackupRunsListResponse {
  148. // This is always **sql#backupRunsList**.
  149. string kind = 1;
  150. // A list of backup runs in reverse chronological order of the enqueued time.
  151. repeated BackupRun items = 2;
  152. // The continuation token, used to page through large result sets. Provide
  153. // this value in a subsequent request to return the next page of results.
  154. string next_page_token = 3;
  155. }
  156. // The status of a backup run.
  157. enum SqlBackupRunStatus {
  158. // The status of the run is unknown.
  159. SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0;
  160. // The backup operation was enqueued.
  161. ENQUEUED = 1;
  162. // The backup is overdue across a given backup window. Indicates a
  163. // problem. Example: Long-running operation in progress during
  164. // the whole window.
  165. OVERDUE = 2;
  166. // The backup is in progress.
  167. RUNNING = 3;
  168. // The backup failed.
  169. FAILED = 4;
  170. // The backup was successful.
  171. SUCCESSFUL = 5;
  172. // The backup was skipped (without problems) for a given backup
  173. // window. Example: Instance was idle.
  174. SKIPPED = 6;
  175. // The backup is about to be deleted.
  176. DELETION_PENDING = 7;
  177. // The backup deletion failed.
  178. DELETION_FAILED = 8;
  179. // The backup has been deleted.
  180. DELETED = 9;
  181. }
  182. // Defines the supported backup kinds.
  183. enum SqlBackupKind {
  184. // This is an unknown BackupKind.
  185. SQL_BACKUP_KIND_UNSPECIFIED = 0;
  186. // The snapshot based backups
  187. SNAPSHOT = 1;
  188. // Physical backups
  189. PHYSICAL = 2;
  190. }
  191. // Type of backup (i.e. automated, on demand, etc).
  192. enum SqlBackupRunType {
  193. // This is an unknown BackupRun type.
  194. SQL_BACKUP_RUN_TYPE_UNSPECIFIED = 0;
  195. // The backup schedule automatically triggers a backup.
  196. AUTOMATED = 1;
  197. // The user manually triggers a backup.
  198. ON_DEMAND = 2;
  199. }