Skip to content

Commit 238579a

Browse files
feat: [batch] add block_project_ssh_keys field to the v1alpha job API to block project level ssh keys access to Batch created VMs (#5604)
* docs: Refine usage scope for fields `task_execution` and `task_state` in StatusEvent PiperOrigin-RevId: 659685089 Source-Link: googleapis/googleapis@00ed8aa Source-Link: googleapis/googleapis-gen@85a9862 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI4NWE5ODYyN2Y5ZTkwZWEyY2IwZTFjMDZlM2E0MTk1OTk0MmNhOTMwIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add block_project_ssh_keys field to the v1alpha job API to block project level ssh keys access to Batch created VMs --- feat: remove visibility restriction of cancel job api, allow in v1alpha --- feat: update Go Datastore import path feat: update Go Bigtable import path --- docs: Refine usage scope for field `task_execution` and `task_state` in `status_events` PiperOrigin-RevId: 659840586 Source-Link: googleapis/googleapis@d4acb64 Source-Link: googleapis/googleapis-gen@024a490 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIwMjRhNDkwMDFkYjE2ZjBhNmIyNmIwNGRiYTBlMDBlNzkwNmJiNjdjIn0= * 🦉 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 7d5a66b commit 238579a

15 files changed

Lines changed: 1321 additions & 10 deletions

File tree

packages/google-cloud-batch/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
117117
| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.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/v1/batch_service.get_task.js,packages/google-cloud-batch/samples/README.md) |
118118
| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/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/v1/batch_service.list_jobs.js,packages/google-cloud-batch/samples/README.md) |
119119
| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/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/v1/batch_service.list_tasks.js,packages/google-cloud-batch/samples/README.md) |
120+
| Batch_service.cancel_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.cancel_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.cancel_job.js,packages/google-cloud-batch/samples/README.md) |
120121
| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_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.create_job.js,packages/google-cloud-batch/samples/README.md) |
121122
| Batch_service.create_resource_allowance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_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.create_resource_allowance.js,packages/google-cloud-batch/samples/README.md) |
122123
| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_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.delete_job.js,packages/google-cloud-batch/samples/README.md) |

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ message ComputeResource {
8181
int64 boot_disk_mib = 4;
8282
}
8383

84-
// Status event
84+
// Status event.
8585
message StatusEvent {
8686
// Type of the event.
8787
string type = 3;
@@ -92,10 +92,13 @@ message StatusEvent {
9292
// The time this event occurred.
9393
google.protobuf.Timestamp event_time = 2;
9494

95-
// Task Execution
95+
// Task Execution.
96+
// This field is only defined for task-level status events where the task
97+
// fails.
9698
TaskExecution task_execution = 4;
9799

98-
// Task State
100+
// Task State.
101+
// This field is only defined for task-level status events.
99102
TaskStatus.State task_state = 5;
100103
}
101104

@@ -116,7 +119,7 @@ message TaskExecution {
116119
int32 exit_code = 1;
117120
}
118121

119-
// Status of a task
122+
// Status of a task.
120123
message TaskStatus {
121124
// Task states.
122125
enum State {
@@ -142,7 +145,7 @@ message TaskStatus {
142145
UNEXECUTED = 6;
143146
}
144147

145-
// Task state
148+
// Task state.
146149
State state = 1;
147150

148151
// Detailed info about why the state is reached.

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

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

78+
// Cancel a Job.
79+
rpc CancelJob(CancelJobRequest) returns (google.longrunning.Operation) {
80+
option (google.api.http) = {
81+
post: "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel"
82+
body: "*"
83+
};
84+
option (google.api.method_signature) = "name";
85+
option (google.longrunning.operation_info) = {
86+
response_type: "CancelJobResponse"
87+
metadata_type: "google.cloud.batch.v1alpha.OperationMetadata"
88+
};
89+
}
90+
7891
// Update a Job.
7992
rpc UpdateJob(UpdateJobRequest) returns (Job) {
8093
option (google.api.http) = {
@@ -233,6 +246,36 @@ message DeleteJobRequest {
233246
string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
234247
}
235248

249+
// CancelJob Request.
250+
message CancelJobRequest {
251+
// Required. Job name.
252+
string name = 1 [
253+
(google.api.field_behavior) = REQUIRED,
254+
(google.api.resource_reference) = { type: "batch.googleapis.com/Job" }
255+
];
256+
257+
// Optional. An optional request ID to identify requests. Specify a unique
258+
// request ID so that if you must retry your request, the server will know to
259+
// ignore the request if it has already been completed. The server will
260+
// guarantee that for at least 60 minutes after the first request.
261+
//
262+
// For example, consider a situation where you make an initial request and
263+
// the request times out. If you make the request again with the same request
264+
// ID, the server can check if original operation with the same request ID
265+
// was received, and if so, will ignore the second request. This prevents
266+
// clients from accidentally creating duplicate commitments.
267+
//
268+
// The request ID must be a valid UUID with the exception that zero UUID is
269+
// not supported (00000000-0000-0000-0000-000000000000).
270+
string request_id = 4 [
271+
(google.api.field_info).format = UUID4,
272+
(google.api.field_behavior) = OPTIONAL
273+
];
274+
}
275+
276+
// Response to the CancelJob request.
277+
message CancelJobResponse {}
278+
236279
// UpdateJob Request.
237280
message UpdateJobRequest {
238281
// Required. The Job to update.

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,25 @@ message AllocationPolicy {
511511
// Optional. Set this field true if you want Batch to install Ops Agent on
512512
// your behalf. Default is false.
513513
bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL];
514+
515+
// Optional. Set this field to `true` if you want Batch to block
516+
// project-level SSH keys from accessing this job's VMs. Alternatively, you
517+
// can configure the job to specify a VM instance template that blocks
518+
// project-level SSH keys. In either case, Batch blocks project-level SSH
519+
// keys while creating the VMs for this job.
520+
//
521+
// Batch allows project-level SSH keys for a job's VMs only if all
522+
// the following are true:
523+
//
524+
// + This field is undefined or set to `false`.
525+
// + The job's VM instance template (if any) doesn't block project-level
526+
// SSH keys.
527+
//
528+
// Notably, you can override this behavior by manually updating a VM to
529+
// block or allow project-level SSH keys. For more information about
530+
// blocking project-level SSH keys, see the Compute Engine documentation:
531+
// https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys
532+
bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL];
514533
}
515534

516535
// A network interface.

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ message ComputeResource {
8686
int64 boot_disk_mib = 4;
8787
}
8888

89-
// Status event
89+
// Status event.
9090
message StatusEvent {
9191
// Type of the event.
9292
string type = 3;
@@ -97,10 +97,13 @@ message StatusEvent {
9797
// The time this event occurred.
9898
google.protobuf.Timestamp event_time = 2;
9999

100-
// Task Execution
100+
// Task Execution.
101+
// This field is only defined for task-level status events where the task
102+
// fails.
101103
TaskExecution task_execution = 4;
102104

103-
// Task State
105+
// Task State.
106+
// This field is only defined for task-level status events.
104107
TaskStatus.State task_state = 5;
105108
}
106109

@@ -125,7 +128,7 @@ message TaskExecution {
125128
string stderr_snippet = 2 [(google.api.field_behavior) = OPTIONAL];
126129
}
127130

128-
// Status of a task
131+
// Status of a task.
129132
message TaskStatus {
130133
// Task states.
131134
enum State {
@@ -151,7 +154,7 @@ message TaskStatus {
151154
UNEXECUTED = 6;
152155
}
153156

154-
// Task state
157+
// Task state.
155158
State state = 1;
156159

157160
// Detailed info about why the state is reached.

0 commit comments

Comments
 (0)