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