Skip to content

Commit d89a145

Browse files
feat: [batch] update Nodejs generator to send API versions in headers for GAPICs (#5336)
* 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 Source-Link: googleapis/googleapis@090d9a1 Source-Link: googleapis/googleapis-gen@d19bc03 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJkMTliYzAzNDI4ZGJkYzdiY2NiYWU4NzUyZGVkMTljODU4ZmExNmY2In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Refine description for field `task_execution` PiperOrigin-RevId: 633294486 Source-Link: googleapis/googleapis@d9fe642 Source-Link: googleapis/googleapis-gen@fd49345 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJmZDQ5MzQ1OTI2Y2FhMDNmYTJhMjUyMTRkODNlMDZiM2JjMzU3NTA5In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Refine description for field `task_execution` PiperOrigin-RevId: 633367898 Source-Link: googleapis/googleapis@7e73d48 Source-Link: googleapis/googleapis-gen@7a9547f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI3YTk1NDdmYmEwNjdmYTNiNDU3ZmI5YWEyOTY4NmNiNWI2MDhkOTMwIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: update Nodejs generator to send API versions in headers for GAPICs PiperOrigin-RevId: 634109303 Source-Link: googleapis/googleapis@998ade8 Source-Link: googleapis/googleapis-gen@000ca6f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIwMDBjYTZmMDA4MDFmNjViODQ3ZTYwMjljYjA1MTExNDA0ZGYyMWVjIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 093bfb2 commit d89a145

15 files changed

Lines changed: 938 additions & 7 deletions

File tree

packages/google-cloud-batch/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
127127
| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js,packages/google-cloud-batch/samples/README.md) |
128128
| Batch_service.list_resource_allowances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_resource_allowances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_resource_allowances.js,packages/google-cloud-batch/samples/README.md) |
129129
| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js,packages/google-cloud-batch/samples/README.md) |
130+
| Batch_service.update_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_job.js,packages/google-cloud-batch/samples/README.md) |
130131
| Batch_service.update_resource_allowance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_resource_allowance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_resource_allowance.js,packages/google-cloud-batch/samples/README.md) |
131132
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/quickstart.js,packages/google-cloud-batch/samples/README.md) |
132133

packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,18 @@ message StatusEvent {
102102
// This Task Execution field includes detail information for
103103
// task execution procedures, based on StatusEvent types.
104104
message TaskExecution {
105-
// When task is completed as the status of FAILED or SUCCEEDED,
106-
// exit code is for one task execution result, default is 0 as success.
105+
// The exit code of a finished task.
106+
//
107+
// If the task succeeded, the exit code will be 0. If the task failed but not
108+
// due to the following reasons, the exit code will be 50000.
109+
//
110+
// Otherwise, it can be from different sources:
111+
// - Batch known failures as
112+
// https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes.
113+
// - Batch runnable execution failures: You can rely on Batch logs for further
114+
// diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs.
115+
// If there are multiple runnables failures, Batch only exposes the first
116+
// error caught for now.
107117
int32 exit_code = 1;
108118
}
109119

packages/google-cloud-batch/protos/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.

packages/google-cloud-batch/protos/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.

packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,18 @@ message StatusEvent {
107107
// This Task Execution field includes detail information for
108108
// task execution procedures, based on StatusEvent types.
109109
message TaskExecution {
110-
// When task is completed as the status of FAILED or SUCCEEDED,
111-
// exit code is for one task execution result, default is 0 as success.
110+
// The exit code of a finished task.
111+
//
112+
// If the task succeeded, the exit code will be 0. If the task failed but not
113+
// due to the following reasons, the exit code will be 50000.
114+
//
115+
// Otherwise, it can be from different sources:
116+
// - Batch known failures as
117+
// https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes.
118+
// - Batch runnable execution failures: You can rely on Batch logs for further
119+
// diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs.
120+
// If there are multiple runnables failures, Batch only exposes the first
121+
// error caught for now.
112122
int32 exit_code = 1;
113123

114124
// Optional. The tail end of any content written to standard error by the task

packages/google-cloud-batch/protos/protos.d.ts

Lines changed: 130 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)