Skip to content

Commit

Permalink
feat: Update description on allowed_locations in LocationPolicy field
Browse files Browse the repository at this point in the history
---
feat: Add UpdateJob API to update the job spec, only task_count is supported now

docs: updated comments
PiperOrigin-RevId: 631869976
  • Loading branch information
Google APIs authored and Copybara-Service committed May 8, 2024
1 parent a5dcade commit 090d9a1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
41 changes: 41 additions & 0 deletions google/cloud/batch/v1alpha/batch.proto
Expand Up @@ -75,6 +75,15 @@ service BatchService {
};
}

// Update a Job.
rpc UpdateJob(UpdateJobRequest) returns (Job) {
option (google.api.http) = {
patch: "/v1alpha/{job.name=projects/*/locations/*/jobs/*}"
body: "job"
};
option (google.api.method_signature) = "job,update_mask";
}

// List all Jobs for a project within a region.
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -224,6 +233,38 @@ message DeleteJobRequest {
string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
}

// UpdateJob Request.
message UpdateJobRequest {
// Required. The Job to update.
// Only fields specified in `update_mask` are updated.
Job job = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Mask of fields to update.
//
// UpdateJob request now only supports update on `task_count` field in a job's
// first task group. Other fields will be ignored.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];

// Optional. An optional request ID to identify requests. Specify a unique
// request ID so that if you must retry your request, the server will know to
// ignore the request if it has already been completed. The server will
// guarantee that for at least 60 minutes after the first request.
//
// For example, consider a situation where you make an initial request and
// the request times out. If you make the request again with the same request
// ID, the server can check if original operation with the same request ID
// was received, and if so, will ignore the second request. This prevents
// clients from accidentally creating duplicate commitments.
//
// The request ID must be a valid UUID with the exception that zero UUID is
// not supported (00000000-0000-0000-0000-000000000000).
string request_id = 3 [
(google.api.field_info).format = UUID4,
(google.api.field_behavior) = OPTIONAL
];
}

// ListJob Request.
message ListJobsRequest {
// Parent path.
Expand Down
6 changes: 3 additions & 3 deletions google/cloud/batch/v1alpha/job.proto
Expand Up @@ -317,11 +317,11 @@ message AllocationPolicy {
// ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
// in zones us-central1-a and us-central1-c.
//
// All locations end up in different regions would cause errors.
// Mixing locations from different regions would cause errors.
// For example,
// ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
// "zones/us-west1-a"] contains 2 regions "us-central1" and
// "us-west1". An error is expected in this case.
// "zones/us-west1-a"] contains locations from two distinct regions:
// us-central1 and us-west1. This combination will trigger an error.
repeated string allowed_locations = 1;

// A list of denied location names.
Expand Down

0 comments on commit 090d9a1

Please sign in to comment.