snapshots.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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.dataflow.v1beta3;
  16. import "google/api/annotations.proto";
  17. import "google/protobuf/duration.proto";
  18. import "google/protobuf/timestamp.proto";
  19. import "google/api/client.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. }
  38. // Deletes a snapshot.
  39. rpc DeleteSnapshot(DeleteSnapshotRequest) returns (DeleteSnapshotResponse) {
  40. }
  41. // Lists snapshots.
  42. rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) {
  43. }
  44. }
  45. // Represents a Pubsub snapshot.
  46. message PubsubSnapshotMetadata {
  47. // The name of the Pubsub topic.
  48. string topic_name = 1;
  49. // The name of the Pubsub snapshot.
  50. string snapshot_name = 2;
  51. // The expire time of the Pubsub snapshot.
  52. google.protobuf.Timestamp expire_time = 3;
  53. }
  54. // Snapshot state.
  55. enum SnapshotState {
  56. // Unknown state.
  57. UNKNOWN_SNAPSHOT_STATE = 0;
  58. // Snapshot intent to create has been persisted, snapshotting of state has not
  59. // yet started.
  60. PENDING = 1;
  61. // Snapshotting is being performed.
  62. RUNNING = 2;
  63. // Snapshot has been created and is ready to be used.
  64. READY = 3;
  65. // Snapshot failed to be created.
  66. FAILED = 4;
  67. // Snapshot has been deleted.
  68. DELETED = 5;
  69. }
  70. // Represents a snapshot of a job.
  71. message Snapshot {
  72. // The unique ID of this snapshot.
  73. string id = 1;
  74. // The project this snapshot belongs to.
  75. string project_id = 2;
  76. // The job this snapshot was created from.
  77. string source_job_id = 3;
  78. // The time this snapshot was created.
  79. google.protobuf.Timestamp creation_time = 4;
  80. // The time after which this snapshot will be automatically deleted.
  81. google.protobuf.Duration ttl = 5;
  82. // State of the snapshot.
  83. SnapshotState state = 6;
  84. // PubSub snapshot metadata.
  85. repeated PubsubSnapshotMetadata pubsub_metadata = 7;
  86. // User specified description of the snapshot. Maybe empty.
  87. string description = 8;
  88. // The disk byte size of the snapshot. Only available for snapshots in READY
  89. // state.
  90. int64 disk_size_bytes = 9;
  91. // Cloud region where this snapshot lives in, e.g., "us-central1".
  92. string region = 10;
  93. }
  94. // Request to get information about a snapshot
  95. message GetSnapshotRequest {
  96. // The ID of the Cloud Platform project that the snapshot belongs to.
  97. string project_id = 1;
  98. // The ID of the snapshot.
  99. string snapshot_id = 2;
  100. // The location that contains this snapshot.
  101. string location = 3;
  102. }
  103. // Request to delete a snapshot.
  104. message DeleteSnapshotRequest {
  105. // The ID of the Cloud Platform project that the snapshot belongs to.
  106. string project_id = 1;
  107. // The ID of the snapshot.
  108. string snapshot_id = 2;
  109. // The location that contains this snapshot.
  110. string location = 3;
  111. }
  112. // Response from deleting a snapshot.
  113. message DeleteSnapshotResponse {
  114. }
  115. // Request to list snapshots.
  116. message ListSnapshotsRequest {
  117. // The project ID to list snapshots for.
  118. string project_id = 1;
  119. // If specified, list snapshots created from this job.
  120. string job_id = 3;
  121. // The location to list snapshots in.
  122. string location = 2;
  123. }
  124. // List of snapshots.
  125. message ListSnapshotsResponse {
  126. // Returned snapshots.
  127. repeated Snapshot snapshots = 1;
  128. }