snapshots.proto 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. // Copyright 2022 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.dataflow.v1beta3;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/protobuf/duration.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3";
  21. option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "SnapshotsProto";
  24. option java_package = "com.google.dataflow.v1beta3";
  25. option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3";
  26. option ruby_package = "Google::Cloud::Dataflow::V1beta3";
  27. // Provides methods to manage snapshots of Google Cloud Dataflow jobs.
  28. service SnapshotsV1Beta3 {
  29. option (google.api.default_host) = "dataflow.googleapis.com";
  30. option (google.api.oauth_scopes) =
  31. "https://www.googleapis.com/auth/cloud-platform,"
  32. "https://www.googleapis.com/auth/compute,"
  33. "https://www.googleapis.com/auth/compute.readonly,"
  34. "https://www.googleapis.com/auth/userinfo.email";
  35. // Gets information about a snapshot.
  36. rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) {
  37. option (google.api.http) = {
  38. get: "/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}"
  39. additional_bindings {
  40. get: "/v1b3/projects/{project_id}/snapshots/{snapshot_id}"
  41. }
  42. };
  43. }
  44. // Deletes a snapshot.
  45. rpc DeleteSnapshot(DeleteSnapshotRequest) returns (DeleteSnapshotResponse) {
  46. option (google.api.http) = {
  47. delete: "/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}"
  48. additional_bindings {
  49. delete: "/v1b3/projects/{project_id}/snapshots"
  50. }
  51. };
  52. }
  53. // Lists snapshots.
  54. rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) {
  55. option (google.api.http) = {
  56. get: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/snapshots"
  57. additional_bindings {
  58. get: "/v1b3/projects/{project_id}/locations/{location}/snapshots"
  59. }
  60. additional_bindings {
  61. get: "/v1b3/projects/{project_id}/snapshots"
  62. }
  63. };
  64. }
  65. }
  66. // Snapshot state.
  67. enum SnapshotState {
  68. // Unknown state.
  69. UNKNOWN_SNAPSHOT_STATE = 0;
  70. // Snapshot intent to create has been persisted, snapshotting of state has not
  71. // yet started.
  72. PENDING = 1;
  73. // Snapshotting is being performed.
  74. RUNNING = 2;
  75. // Snapshot has been created and is ready to be used.
  76. READY = 3;
  77. // Snapshot failed to be created.
  78. FAILED = 4;
  79. // Snapshot has been deleted.
  80. DELETED = 5;
  81. }
  82. // Represents a Pubsub snapshot.
  83. message PubsubSnapshotMetadata {
  84. // The name of the Pubsub topic.
  85. string topic_name = 1;
  86. // The name of the Pubsub snapshot.
  87. string snapshot_name = 2;
  88. // The expire time of the Pubsub snapshot.
  89. google.protobuf.Timestamp expire_time = 3;
  90. }
  91. // Represents a snapshot of a job.
  92. message Snapshot {
  93. // The unique ID of this snapshot.
  94. string id = 1;
  95. // The project this snapshot belongs to.
  96. string project_id = 2;
  97. // The job this snapshot was created from.
  98. string source_job_id = 3;
  99. // The time this snapshot was created.
  100. google.protobuf.Timestamp creation_time = 4;
  101. // The time after which this snapshot will be automatically deleted.
  102. google.protobuf.Duration ttl = 5;
  103. // State of the snapshot.
  104. SnapshotState state = 6;
  105. // Pub/Sub snapshot metadata.
  106. repeated PubsubSnapshotMetadata pubsub_metadata = 7;
  107. // User specified description of the snapshot. Maybe empty.
  108. string description = 8;
  109. // The disk byte size of the snapshot. Only available for snapshots in READY
  110. // state.
  111. int64 disk_size_bytes = 9;
  112. // Cloud region where this snapshot lives in, e.g., "us-central1".
  113. string region = 10;
  114. }
  115. // Request to get information about a snapshot
  116. message GetSnapshotRequest {
  117. // The ID of the Cloud Platform project that the snapshot belongs to.
  118. string project_id = 1;
  119. // The ID of the snapshot.
  120. string snapshot_id = 2;
  121. // The location that contains this snapshot.
  122. string location = 3;
  123. }
  124. // Request to delete a snapshot.
  125. message DeleteSnapshotRequest {
  126. // The ID of the Cloud Platform project that the snapshot belongs to.
  127. string project_id = 1;
  128. // The ID of the snapshot.
  129. string snapshot_id = 2;
  130. // The location that contains this snapshot.
  131. string location = 3;
  132. }
  133. // Response from deleting a snapshot.
  134. message DeleteSnapshotResponse {
  135. }
  136. // Request to list snapshots.
  137. message ListSnapshotsRequest {
  138. // The project ID to list snapshots for.
  139. string project_id = 1;
  140. // If specified, list snapshots created from this job.
  141. string job_id = 3;
  142. // The location to list snapshots in.
  143. string location = 2;
  144. }
  145. // List of snapshots.
  146. message ListSnapshotsResponse {
  147. // Returned snapshots.
  148. repeated Snapshot snapshots = 1;
  149. }