Skip to content

Commit fb371ad

Browse files
Google APIscopybara-github
authored andcommitted
feat: add QUEUED state to Storage Batch Operations API
feat: add bucket operations feat: add `is_multi_bucket_job` output field added to StorageBatchOperations Job PiperOrigin-RevId: 869283881
1 parent 772f196 commit fb371ad

File tree

2 files changed

+167
-2
lines changed

2 files changed

+167
-2
lines changed

google/cloud/storagebatchoperations/v1/storage_batch_operations.proto

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -88,6 +88,23 @@ service StorageBatchOperations {
8888
};
8989
option (google.api.method_signature) = "name";
9090
}
91+
92+
// Lists BucketOperations in a given project and job.
93+
rpc ListBucketOperations(ListBucketOperationsRequest)
94+
returns (ListBucketOperationsResponse) {
95+
option (google.api.http) = {
96+
get: "/v1/{parent=projects/*/locations/*/jobs/*}/bucketOperations"
97+
};
98+
option (google.api.method_signature) = "parent";
99+
}
100+
101+
// Gets a BucketOperation.
102+
rpc GetBucketOperation(GetBucketOperationRequest) returns (BucketOperation) {
103+
option (google.api.http) = {
104+
get: "/v1/{name=projects/*/locations/*/jobs/*/bucketOperations/*}"
105+
};
106+
option (google.api.method_signature) = "name";
107+
}
91108
}
92109

93110
// Message for request to list Jobs
@@ -209,11 +226,65 @@ message DeleteJobRequest {
209226
(google.api.field_info).format = UUID4,
210227
(google.api.field_behavior) = OPTIONAL
211228
];
229+
230+
// Optional. If set to true, any child bucket operations of the job will also
231+
// be deleted. Highly recommended to be set to true by all clients. Users
232+
// cannot mutate bucket operations directly, so only the jobs.delete
233+
// permission is required to delete a job (and its child bucket operations).
234+
bool force = 3 [(google.api.field_behavior) = OPTIONAL];
212235
}
213236

214237
// Message for response to cancel Job.
215238
message CancelJobResponse {}
216239

240+
// Message for request to list BucketOperations
241+
message ListBucketOperationsRequest {
242+
// Required. Format: projects/{project_id}/locations/global/jobs/{job_id}.
243+
string parent = 1 [
244+
(google.api.field_behavior) = REQUIRED,
245+
(google.api.resource_reference) = {
246+
child_type: "storagebatchoperations.googleapis.com/BucketOperation"
247+
}
248+
];
249+
250+
// Optional. Filters results as defined by https://google.aip.dev/160.
251+
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
252+
253+
// Optional. The list page size. Default page size is 100.
254+
int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
255+
256+
// Optional. The list page token.
257+
string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
258+
259+
// Optional. Field to sort by. Supported fields are name, create_time.
260+
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
261+
}
262+
263+
// Message for response to listing BucketOperations
264+
message ListBucketOperationsResponse {
265+
// A list of storage batch bucket operations.
266+
repeated BucketOperation bucket_operations = 1;
267+
268+
// A token identifying a page of results.
269+
string next_page_token = 2;
270+
271+
// Locations that could not be reached.
272+
repeated string unreachable = 3;
273+
}
274+
275+
// Message for getting a BucketOperation.
276+
message GetBucketOperationRequest {
277+
// Required. `name` of the bucket operation to retrieve.
278+
// Format:
279+
// projects/{project_id}/locations/global/jobs/{job_id}/bucketOperations/{bucket_operation_id}.
280+
string name = 1 [
281+
(google.api.field_behavior) = REQUIRED,
282+
(google.api.resource_reference) = {
283+
type: "storagebatchoperations.googleapis.com/BucketOperation"
284+
}
285+
];
286+
}
287+
217288
// Represents the metadata of the long-running operation.
218289
message OperationMetadata {
219290
// Output only. The unique operation resource name.

google/cloud/storagebatchoperations/v1/storage_batch_operations_types.proto

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -58,6 +58,9 @@ message Job {
5858

5959
// Terminated due to an unrecoverable failure.
6060
FAILED = 4;
61+
62+
// Queued but not yet started.
63+
QUEUED = 5;
6164
}
6265

6366
// Identifier. The resource name of the Job. job_id is unique
@@ -123,6 +126,97 @@ message Job {
123126
// object count and, if the object configuration is a prefix list, the bytes
124127
// found from source. No transformations will be performed.
125128
bool dry_run = 22 [(google.api.field_behavior) = OPTIONAL];
129+
130+
// Output only. If true, this Job operates on multiple buckets. Multibucket
131+
// jobs are subject to different quota limits than single-bucket jobs.
132+
bool is_multi_bucket_job = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
133+
}
134+
135+
// BucketOperation represents a bucket-level breakdown of a Job.
136+
message BucketOperation {
137+
option (google.api.resource) = {
138+
type: "storagebatchoperations.googleapis.com/BucketOperation"
139+
pattern: "projects/{project}/locations/{location}/jobs/{job}/bucketOperations/{bucket_operation}"
140+
plural: "bucketoperations"
141+
singular: "bucketOperation"
142+
};
143+
144+
// Describes state of the BucketOperation.
145+
enum State {
146+
// Default value. This value is unused.
147+
STATE_UNSPECIFIED = 0;
148+
149+
// Created but not yet started.
150+
QUEUED = 1;
151+
152+
// In progress.
153+
RUNNING = 2;
154+
155+
// Completed successfully.
156+
SUCCEEDED = 3;
157+
158+
// Cancelled by the user.
159+
CANCELED = 4;
160+
161+
// Terminated due to an unrecoverable failure.
162+
FAILED = 5;
163+
}
164+
165+
// Identifier. The resource name of the BucketOperation. This is defined by
166+
// the service. Format:
167+
// projects/{project}/locations/global/jobs/{job_id}/bucketOperations/{bucket_operation}.
168+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
169+
170+
// The bucket name of the objects to be transformed in the BucketOperation.
171+
string bucket_name = 2;
172+
173+
// Specifies objects to be transformed in the BucketOperation.
174+
oneof object_configuration {
175+
// Specifies objects matching a prefix set.
176+
PrefixList prefix_list = 3;
177+
178+
// Specifies objects in a manifest file.
179+
Manifest manifest = 4;
180+
}
181+
182+
// Action to be performed on the objects.
183+
oneof transformation {
184+
// Changes object hold status.
185+
PutObjectHold put_object_hold = 11;
186+
187+
// Delete objects.
188+
DeleteObject delete_object = 12;
189+
190+
// Updates object metadata. Allows updating fixed-key and custom metadata
191+
// and fixed-key metadata i.e. Cache-Control, Content-Disposition,
192+
// Content-Encoding, Content-Language, Content-Type, Custom-Time.
193+
PutMetadata put_metadata = 13;
194+
195+
// Rewrite the object and updates metadata like KMS key.
196+
RewriteObject rewrite_object = 14;
197+
}
198+
199+
// Output only. The time that the BucketOperation was created.
200+
google.protobuf.Timestamp create_time = 5
201+
[(google.api.field_behavior) = OUTPUT_ONLY];
202+
203+
// Output only. The time that the BucketOperation was started.
204+
google.protobuf.Timestamp start_time = 6
205+
[(google.api.field_behavior) = OUTPUT_ONLY];
206+
207+
// Output only. The time that the BucketOperation was completed.
208+
google.protobuf.Timestamp complete_time = 7
209+
[(google.api.field_behavior) = OUTPUT_ONLY];
210+
211+
// Output only. Information about the progress of the bucket operation.
212+
Counters counters = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
213+
214+
// Output only. Summarizes errors encountered with sample error log entries.
215+
repeated ErrorSummary error_summaries = 9
216+
[(google.api.field_behavior) = OUTPUT_ONLY];
217+
218+
// Output only. State of the BucketOperation.
219+
State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
126220
}
127221

128222
// Describes list of buckets and their objects to be transformed.

0 commit comments

Comments
 (0)