Skip to content

Commit 090d9a1

Browse files
Google APIscopybara-github
authored andcommitted
feat: Update description on allowed_locations in LocationPolicy field
--- feat: Add UpdateJob API to update the job spec, only task_count is supported now docs: updated comments PiperOrigin-RevId: 631869976
1 parent a5dcade commit 090d9a1

2 files changed

Lines changed: 44 additions & 3 deletions

File tree

google/cloud/batch/v1alpha/batch.proto

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ service BatchService {
7575
};
7676
}
7777

78+
// Update a Job.
79+
rpc UpdateJob(UpdateJobRequest) returns (Job) {
80+
option (google.api.http) = {
81+
patch: "/v1alpha/{job.name=projects/*/locations/*/jobs/*}"
82+
body: "job"
83+
};
84+
option (google.api.method_signature) = "job,update_mask";
85+
}
86+
7887
// List all Jobs for a project within a region.
7988
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
8089
option (google.api.http) = {
@@ -224,6 +233,38 @@ message DeleteJobRequest {
224233
string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
225234
}
226235

236+
// UpdateJob Request.
237+
message UpdateJobRequest {
238+
// Required. The Job to update.
239+
// Only fields specified in `update_mask` are updated.
240+
Job job = 1 [(google.api.field_behavior) = REQUIRED];
241+
242+
// Required. Mask of fields to update.
243+
//
244+
// UpdateJob request now only supports update on `task_count` field in a job's
245+
// first task group. Other fields will be ignored.
246+
google.protobuf.FieldMask update_mask = 2
247+
[(google.api.field_behavior) = REQUIRED];
248+
249+
// Optional. An optional request ID to identify requests. Specify a unique
250+
// request ID so that if you must retry your request, the server will know to
251+
// ignore the request if it has already been completed. The server will
252+
// guarantee that for at least 60 minutes after the first request.
253+
//
254+
// For example, consider a situation where you make an initial request and
255+
// the request times out. If you make the request again with the same request
256+
// ID, the server can check if original operation with the same request ID
257+
// was received, and if so, will ignore the second request. This prevents
258+
// clients from accidentally creating duplicate commitments.
259+
//
260+
// The request ID must be a valid UUID with the exception that zero UUID is
261+
// not supported (00000000-0000-0000-0000-000000000000).
262+
string request_id = 3 [
263+
(google.api.field_info).format = UUID4,
264+
(google.api.field_behavior) = OPTIONAL
265+
];
266+
}
267+
227268
// ListJob Request.
228269
message ListJobsRequest {
229270
// Parent path.

google/cloud/batch/v1alpha/job.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,11 @@ message AllocationPolicy {
317317
// ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
318318
// in zones us-central1-a and us-central1-c.
319319
//
320-
// All locations end up in different regions would cause errors.
320+
// Mixing locations from different regions would cause errors.
321321
// For example,
322322
// ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
323-
// "zones/us-west1-a"] contains 2 regions "us-central1" and
324-
// "us-west1". An error is expected in this case.
323+
// "zones/us-west1-a"] contains locations from two distinct regions:
324+
// us-central1 and us-west1. This combination will trigger an error.
325325
repeated string allowed_locations = 1;
326326

327327
// A list of denied location names.

0 commit comments

Comments
 (0)