Skip to content

Commit 8f3e57f

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add support for creating Job resource in dry-run mode
feat: Add object retention setting to StorageBatchOperations API feat: Launch StorageBatchOperations permissions and roles to GA feat: Launch storagebatchoperations resource permissions to GA feat: Add inclusion scopes docs: Fix comment formatting chore: Add Tag Manager IAM permissions for multiple GCP services Clients can now create Job in dry-run mode, returning the total object count and, if the object configuration is a prefix list, the bytes found from source. No transformations will be performed. PiperOrigin-RevId: 843787937
1 parent 55ab9c6 commit 8f3e57f

3 files changed

Lines changed: 67 additions & 18 deletions

File tree

google/cloud/storagebatchoperations/v1/BUILD.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ proto_library(
3131
"//google/api:annotations_proto",
3232
"//google/api:client_proto",
3333
"//google/api:field_behavior_proto",
34+
"//google/api:field_info_proto",
3435
"//google/api:resource_proto",
3536
"//google/longrunning:operations_proto",
3637
"//google/rpc:code_proto",
@@ -184,6 +185,8 @@ py_gapic_library(
184185
rest_numeric_enums = True,
185186
service_yaml = "storagebatchoperations_v1.yaml",
186187
transport = "grpc+rest",
188+
deps = [
189+
],
187190
)
188191

189192
py_test(
@@ -299,9 +302,7 @@ ruby_grpc_library(
299302
ruby_cloud_gapic_library(
300303
name = "storagebatchoperations_ruby_gapic",
301304
srcs = [":storagebatchoperations_proto_with_info"],
302-
extra_protoc_parameters = [
303-
"ruby-cloud-gem-name=google-cloud-storage_batch_operations-v1",
304-
],
305+
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-storage_batch_operations-v1"],
305306
grpc_service_config = "storagebatchoperations_grpc_service_config.json",
306307
rest_numeric_enums = True,
307308
service_yaml = "storagebatchoperations_v1.yaml",

google/cloud/storagebatchoperations/v1/storage_batch_operations.proto

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package google.cloud.storagebatchoperations.v1;
1919
import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
22+
import "google/api/field_info.proto";
2223
import "google/api/resource.proto";
2324
import "google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto";
2425
import "google/longrunning/operations.proto";
@@ -160,7 +161,10 @@ message CreateJobRequest {
160161
// `request_id` will be ignored for at least 60 minutes since the first
161162
// request. The request ID must be a valid UUID with the exception that zero
162163
// UUID is not supported (00000000-0000-0000-0000-000000000000).
163-
string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
164+
string request_id = 4 [
165+
(google.api.field_info).format = UUID4,
166+
(google.api.field_behavior) = OPTIONAL
167+
];
164168
}
165169

166170
// Message for Job to Cancel
@@ -179,7 +183,10 @@ message CancelJobRequest {
179183
// `request_id` will be ignored for at least 60 minutes since the first
180184
// request. The request ID must be a valid UUID with the exception that zero
181185
// UUID is not supported (00000000-0000-0000-0000-000000000000).
182-
string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
186+
string request_id = 3 [
187+
(google.api.field_info).format = UUID4,
188+
(google.api.field_behavior) = OPTIONAL
189+
];
183190
}
184191

185192
// Message for deleting a Job
@@ -198,7 +205,10 @@ message DeleteJobRequest {
198205
// `request_id` will be ignored for at least 60 minutes since the first
199206
// request. The request ID must be a valid UUID with the exception that zero
200207
// UUID is not supported (00000000-0000-0000-0000-000000000000).
201-
string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
208+
string request_id = 2 [
209+
(google.api.field_info).format = UUID4,
210+
(google.api.field_behavior) = OPTIONAL
211+
];
202212
}
203213

204214
// Message for response to cancel Job.

google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ message Job {
118118

119119
// Output only. State of the job.
120120
State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
121+
122+
// Optional. If true, the job will run in dry run mode, returning the total
123+
// object count and, if the object configuration is a prefix list, the bytes
124+
// found from source. No transformations will be performed.
125+
bool dry_run = 22 [(google.api.field_behavior) = OPTIONAL];
121126
}
122127

123128
// Describes list of buckets and their objects to be transformed.
@@ -150,11 +155,9 @@ message Manifest {
150155
// a CSV file in a Google Cloud Storage bucket. Each row in the file must
151156
// include the object details i.e. BucketId and Name. Generation may
152157
// optionally be specified. When it is not specified the live object is acted
153-
// upon.
154-
// `manifest_location` should either be
155-
// 1) An absolute path to the object in the format of
156-
// `gs://bucket_name/path/file_name.csv`.
157-
// 2) An absolute path with a single wildcard character in the file name, for
158+
// upon. `manifest_location` should either be 1) An absolute path to the
159+
// object in the format of `gs://bucket_name/path/file_name.csv`. 2) An
160+
// absolute path with a single wildcard character in the file name, for
158161
// example `gs://bucket_name/path/file_name*.csv`.
159162
// If manifest location is specified with a wildcard, objects in all manifest
160163
// files matching the pattern will be acted upon.
@@ -230,6 +233,31 @@ message RewriteObject {
230233
];
231234
}
232235

236+
// Describes options for object retention update.
237+
message ObjectRetention {
238+
// Describes the retention mode.
239+
enum RetentionMode {
240+
// If set and retain_until_time is empty, clears the retention.
241+
RETENTION_MODE_UNSPECIFIED = 0;
242+
243+
// Sets the retention mode to locked.
244+
LOCKED = 1;
245+
246+
// Sets the retention mode to unlocked.
247+
UNLOCKED = 2;
248+
}
249+
250+
// Required. The time when the object will be retained until. UNSET will clear
251+
// the retention. Must be specified in RFC 3339 format e.g.
252+
// YYYY-MM-DD'T'HH:MM:SS.SS'Z' or YYYY-MM-DD'T'HH:MM:SS'Z'.
253+
optional string retain_until_time = 1
254+
[(google.api.field_behavior) = REQUIRED];
255+
256+
// Required. The retention mode of the object.
257+
optional RetentionMode retention_mode = 2
258+
[(google.api.field_behavior) = REQUIRED];
259+
}
260+
233261
// Describes options for object metadata update.
234262
message PutMetadata {
235263
// Optional. Updates objects Content-Disposition fixed metadata. Unset values
@@ -253,16 +281,13 @@ message PutMetadata {
253281
optional string content_language = 3 [(google.api.field_behavior) = OPTIONAL];
254282

255283
// Optional. Updates objects Content-Type fixed metadata. Unset values will be
256-
// ignored.
257-
// Set empty values to clear the metadata. Refer to documentation in
258-
// https://cloud.google.com/storage/docs/metadata#content-type
284+
// ignored. Set empty values to clear the metadata. Refer to documentation in
285+
// https://cloud.google.com/storage/docs/metadata#content-type
259286
optional string content_type = 4 [(google.api.field_behavior) = OPTIONAL];
260287

261288
// Optional. Updates objects Cache-Control fixed metadata. Unset values will
262-
// be
263-
// ignored. Set empty values to clear the metadata.
264-
// Additionally, the value for Custom-Time cannot decrease. Refer to
265-
// documentation in
289+
// be ignored. Set empty values to clear the metadata. Additionally, the value
290+
// for Custom-Time cannot decrease. Refer to documentation in
266291
// https://cloud.google.com/storage/docs/metadata#caching_data.
267292
optional string cache_control = 5 [(google.api.field_behavior) = OPTIONAL];
268293

@@ -278,6 +303,14 @@ message PutMetadata {
278303
// https://cloud.google.com/storage/docs/metadata#custom-metadata
279304
map<string, string> custom_metadata = 7
280305
[(google.api.field_behavior) = OPTIONAL];
306+
307+
// Optional. Updates objects retention lock configuration. Unset values will
308+
// be ignored. Set empty values to clear the retention for the object with
309+
// existing `Unlocked` retention mode. Object with existing `Locked` retention
310+
// mode cannot be cleared or reduce retain_until_time. Refer to documentation
311+
// in https://cloud.google.com/storage/docs/object-lock
312+
optional ObjectRetention object_retention = 8
313+
[(google.api.field_behavior) = OPTIONAL];
281314
}
282315

283316
// A summary of errors by error code, plus a count and sample error log
@@ -320,6 +353,11 @@ message Counters {
320353

321354
// Output only. Number of objects failed.
322355
int64 failed_object_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
356+
357+
// Output only. Number of bytes found from source. This field is only
358+
// populated for jobs with a prefix list object configuration.
359+
optional int64 total_bytes_found = 4
360+
[(google.api.field_behavior) = OUTPUT_ONLY];
323361
}
324362

325363
// Specifies the Cloud Logging behavior.

0 commit comments

Comments
 (0)