google-cloud-batch-v1 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/google/cloud/batch/v1/batch_pb.rb +1 -0
  4. data/lib/google/cloud/batch/v1/batch_service/client.rb +18 -36
  5. data/lib/google/cloud/batch/v1/batch_service/operations.rb +14 -16
  6. data/lib/google/cloud/batch/v1/batch_service/rest/client.rb +810 -0
  7. data/lib/google/cloud/batch/v1/batch_service/rest/operations.rb +793 -0
  8. data/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb +403 -0
  9. data/lib/google/cloud/batch/v1/batch_service/rest.rb +56 -0
  10. data/lib/google/cloud/batch/v1/batch_service.rb +6 -0
  11. data/lib/google/cloud/batch/v1/bindings_override.rb +102 -0
  12. data/lib/google/cloud/batch/v1/job_pb.rb +6 -0
  13. data/lib/google/cloud/batch/v1/rest.rb +38 -0
  14. data/lib/google/cloud/batch/v1/task_pb.rb +3 -0
  15. data/lib/google/cloud/batch/v1/version.rb +1 -1
  16. data/lib/google/cloud/batch/v1.rb +5 -0
  17. data/lib/google/iam/v1/bindings_override.rb +100 -0
  18. data/lib/google/iam/v1/iam_policy/client.rb +639 -0
  19. data/lib/google/iam/v1/iam_policy/credentials.rb +42 -0
  20. data/lib/google/iam/v1/iam_policy/rest/client.rb +558 -0
  21. data/lib/google/iam/v1/iam_policy/rest/service_stub.rb +226 -0
  22. data/lib/google/iam/v1/iam_policy/rest.rb +75 -0
  23. data/lib/google/iam/v1/iam_policy.rb +77 -0
  24. data/lib/google/iam/v1/rest.rb +36 -0
  25. data/lib/google/iam/v1.rb +43 -0
  26. data/lib/google-cloud-batch-v1.rb +1 -0
  27. data/proto_docs/google/api/client.rb +67 -4
  28. data/proto_docs/google/cloud/batch/v1/batch.rb +4 -4
  29. data/proto_docs/google/cloud/batch/v1/job.rb +53 -16
  30. data/proto_docs/google/cloud/batch/v1/task.rb +46 -10
  31. data/proto_docs/google/iam/v1/iam_policy.rb +87 -0
  32. data/proto_docs/google/iam/v1/options.rb +50 -0
  33. data/proto_docs/google/iam/v1/policy.rb +422 -0
  34. metadata +32 -20
@@ -32,7 +32,8 @@ module Google
32
32
  # @!attribute [rw] priority
33
33
  # @return [::Integer]
34
34
  # Priority of the Job.
35
- # The valid value range is [0, 100).
35
+ # The valid value range is [0, 100). Default value is 0.
36
+ # Higher value indicates higher priority.
36
37
  # A job with higher priority value is more likely to run earlier if all other
37
38
  # requirements are satisfied.
38
39
  # @!attribute [rw] task_groups
@@ -274,6 +275,9 @@ module Google
274
275
  # @!attribute [rw] network
275
276
  # @return [::Google::Cloud::Batch::V1::AllocationPolicy::NetworkPolicy]
276
277
  # The network policy.
278
+ # @!attribute [rw] placement
279
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::PlacementPolicy]
280
+ # The placement policy.
277
281
  class AllocationPolicy
278
282
  include ::Google::Protobuf::MessageExts
279
283
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -281,12 +285,14 @@ module Google
281
285
  # @!attribute [rw] allowed_locations
282
286
  # @return [::Array<::String>]
283
287
  # A list of allowed location names represented by internal URLs.
288
+ #
284
289
  # Each location can be a region or a zone.
285
290
  # Only one region or multiple zones in one region is supported now.
286
291
  # For example,
287
292
  # ["regions/us-central1"] allow VMs in any zones in region us-central1.
288
293
  # ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
289
294
  # in zones us-central1-a and us-central1-c.
295
+ #
290
296
  # All locations end up in different regions would cause errors.
291
297
  # For example,
292
298
  # ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
@@ -299,24 +305,28 @@ module Google
299
305
 
300
306
  # A new persistent disk or a local ssd.
301
307
  # A VM can only have one local SSD setting but multiple local SSD partitions.
302
- # https://cloud.google.com/compute/docs/disks#pdspecs.
308
+ # See https://cloud.google.com/compute/docs/disks#pdspecs and
303
309
  # https://cloud.google.com/compute/docs/disks#localssds.
304
310
  # @!attribute [rw] image
305
311
  # @return [::String]
306
312
  # Name of a public or custom image used as the data source.
307
313
  # For example, the following are all valid URLs:
308
- # (1) Specify the image by its family name:
314
+ #
315
+ # * Specify the image by its family name:
309
316
  # projects/\\{project}/global/images/family/\\{image_family}
310
- # (2) Specify the image version:
317
+ # * Specify the image version:
311
318
  # projects/\\{project}/global/images/\\{image_version}
319
+ #
312
320
  # You can also use Batch customized image in short names.
313
321
  # The following image values are supported for a boot disk:
314
- # "batch-debian": use Batch Debian images.
315
- # "batch-centos": use Batch CentOS images.
316
- # "batch-cos": use Batch Container-Optimized images.
322
+ #
323
+ # * "batch-debian": use Batch Debian images.
324
+ # * "batch-centos": use Batch CentOS images.
325
+ # * "batch-cos": use Batch Container-Optimized images.
317
326
  # @!attribute [rw] snapshot
318
327
  # @return [::String]
319
328
  # Name of a snapshot used as the data source.
329
+ # Snapshot is not supported as boot disk now.
320
330
  # @!attribute [rw] type
321
331
  # @return [::String]
322
332
  # Disk type as shown in `gcloud compute disk-types list`.
@@ -326,6 +336,7 @@ module Google
326
336
  # @!attribute [rw] size_gb
327
337
  # @return [::Integer]
328
338
  # Disk size in GB.
339
+ #
329
340
  # For persistent disk, this field is ignored if `data_source` is `image` or
330
341
  # `snapshot`.
331
342
  # For local SSD, size_gb should be a multiple of 375GB,
@@ -387,7 +398,7 @@ module Google
387
398
  # @return [::String]
388
399
  # The minimum CPU platform.
389
400
  # See
390
- # `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
401
+ # https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
391
402
  # Not yet implemented.
392
403
  # @!attribute [rw] provisioning_model
393
404
  # @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
@@ -397,8 +408,9 @@ module Google
397
408
  # The accelerators attached to each VM instance.
398
409
  # @!attribute [rw] boot_disk
399
410
  # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
400
- # Book disk to be created and attached to each VM by this InstancePolicy.
411
+ # Boot disk to be created and attached to each VM by this InstancePolicy.
401
412
  # Boot disk will be deleted when the VM is deleted.
413
+ # Batch API now only supports booting from image.
402
414
  # @!attribute [rw] disks
403
415
  # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
404
416
  # Non-boot disks to be attached for each VM created by this InstancePolicy.
@@ -433,18 +445,22 @@ module Google
433
445
  # @return [::String]
434
446
  # The URL of an existing network resource.
435
447
  # You can specify the network as a full or partial URL.
448
+ #
436
449
  # For example, the following are all valid URLs:
437
- # https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
438
- # projects/\\{project}/global/networks/\\{network}
439
- # global/networks/\\{network}
450
+ #
451
+ # * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
452
+ # * projects/\\{project}/global/networks/\\{network}
453
+ # * global/networks/\\{network}
440
454
  # @!attribute [rw] subnetwork
441
455
  # @return [::String]
442
456
  # The URL of an existing subnetwork resource in the network.
443
457
  # You can specify the subnetwork as a full or partial URL.
458
+ #
444
459
  # For example, the following are all valid URLs:
445
- # https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
446
- # projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
447
- # regions/\\{region}/subnetworks/\\{subnetwork}
460
+ #
461
+ # * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
462
+ # * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
463
+ # * regions/\\{region}/subnetworks/\\{subnetwork}
448
464
  # @!attribute [rw] no_external_ip_address
449
465
  # @return [::Boolean]
450
466
  # Default is false (with an external IP address). Required if
@@ -468,6 +484,26 @@ module Google
468
484
  extend ::Google::Protobuf::MessageExts::ClassMethods
469
485
  end
470
486
 
487
+ # PlacementPolicy describes a group placement policy for the VMs controlled
488
+ # by this AllocationPolicy.
489
+ # @!attribute [rw] collocation
490
+ # @return [::String]
491
+ # UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
492
+ # want VMs to be located close to each other for low network latency
493
+ # between the VMs. No placement policy will be generated when collocation
494
+ # is UNSPECIFIED.
495
+ # @!attribute [rw] max_distance
496
+ # @return [::Integer]
497
+ # When specified, causes the job to fail if more than max_distance logical
498
+ # switches are required between VMs. Batch uses the most compact possible
499
+ # placement of VMs even when max_distance is not specified. An explicit
500
+ # max_distance makes that level of compactness a strict requirement.
501
+ # Not yet implemented
502
+ class PlacementPolicy
503
+ include ::Google::Protobuf::MessageExts
504
+ extend ::Google::Protobuf::MessageExts::ClassMethods
505
+ end
506
+
471
507
  # @!attribute [rw] key
472
508
  # @return [::String]
473
509
  # @!attribute [rw] value
@@ -512,11 +548,12 @@ module Google
512
548
  # @!attribute [rw] task_count
513
549
  # @return [::Integer]
514
550
  # Number of Tasks in the TaskGroup.
515
- # default is 1
551
+ # Default is 1.
516
552
  # @!attribute [rw] parallelism
517
553
  # @return [::Integer]
518
554
  # Max number of tasks that can run in parallel.
519
555
  # Default to min(task_count, 1000).
556
+ # Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
520
557
  # @!attribute [rw] task_environments
521
558
  # @return [::Array<::Google::Cloud::Batch::V1::Environment>]
522
559
  # An array of environment variable mappings, which are passed to Tasks with
@@ -49,6 +49,9 @@ module Google
49
49
  # @!attribute [rw] task_execution
50
50
  # @return [::Google::Cloud::Batch::V1::TaskExecution]
51
51
  # Task Execution
52
+ # @!attribute [rw] task_state
53
+ # @return [::Google::Cloud::Batch::V1::TaskStatus::State]
54
+ # Task State
52
55
  class StatusEvent
53
56
  include ::Google::Protobuf::MessageExts
54
57
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -78,7 +81,7 @@ module Google
78
81
 
79
82
  # Task states.
80
83
  module State
81
- # unknown state
84
+ # Unknown state.
82
85
  STATE_UNSPECIFIED = 0
83
86
 
84
87
  # The Task is created and waiting for resources.
@@ -95,6 +98,9 @@ module Google
95
98
 
96
99
  # The Task has succeeded.
97
100
  SUCCEEDED = 5
101
+
102
+ # The Task has not been executed when the Job finishes.
103
+ UNEXECUTED = 6
98
104
  end
99
105
  end
100
106
 
@@ -135,6 +141,9 @@ module Google
135
141
  # @!attribute [rw] timeout
136
142
  # @return [::Google::Protobuf::Duration]
137
143
  # Timeout for this Runnable.
144
+ # @!attribute [rw] labels
145
+ # @return [::Google::Protobuf::Map{::String => ::String}]
146
+ # Labels for this Runnable.
138
147
  class Runnable
139
148
  include ::Google::Protobuf::MessageExts
140
149
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -163,8 +172,9 @@ module Google
163
172
  # @!attribute [rw] block_external_network
164
173
  # @return [::Boolean]
165
174
  # If set to true, external network access to and from container will be
166
- # blocked. The container will use the default internal network
167
- # 'goog-internal'.
175
+ # blocked, containers that are with block_external_network as true can
176
+ # still communicate with each other, network cannot be specified in the
177
+ # `container.options` field.
168
178
  # @!attribute [rw] username
169
179
  # @return [::String]
170
180
  # Optional username for logging in to a docker registry. If username
@@ -184,9 +194,23 @@ module Google
184
194
  # @!attribute [rw] path
185
195
  # @return [::String]
186
196
  # Script file path on the host VM.
197
+ #
198
+ # To specify an interpreter, please add a `#!<interpreter>`(also known as
199
+ # [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
200
+ # first line of the file.(For example, to execute the script using bash,
201
+ # `#!/bin/bash` should be the first line of the file. To execute the
202
+ # script using`Python3`, `#!/usr/bin/env python3` should be the first
203
+ # line of the file.) Otherwise, the file will by default be excuted by
204
+ # `/bin/sh`.
187
205
  # @!attribute [rw] text
188
206
  # @return [::String]
189
207
  # Shell script text.
208
+ #
209
+ # To specify an interpreter, please add a `#!<interpreter>\n` at the
210
+ # beginning of the text.(For example, to execute the script using bash,
211
+ # `#!/bin/bash\n` should be added. To execute the script using`Python3`,
212
+ # `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
213
+ # by default be excuted by `/bin/sh`.
190
214
  class Script
191
215
  include ::Google::Protobuf::MessageExts
192
216
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -201,6 +225,15 @@ module Google
201
225
  include ::Google::Protobuf::MessageExts
202
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
203
227
  end
228
+
229
+ # @!attribute [rw] key
230
+ # @return [::String]
231
+ # @!attribute [rw] value
232
+ # @return [::String]
233
+ class LabelsEntry
234
+ include ::Google::Protobuf::MessageExts
235
+ extend ::Google::Protobuf::MessageExts::ClassMethods
236
+ end
204
237
  end
205
238
 
206
239
  # Spec of a task
@@ -231,13 +264,12 @@ module Google
231
264
  # @!attribute [rw] lifecycle_policies
232
265
  # @return [::Array<::Google::Cloud::Batch::V1::LifecyclePolicy>]
233
266
  # Lifecycle management schema when any task in a task group is failed.
234
- # The valid size of lifecycle policies are [0, 10].
235
- # For each lifecycle policy, when the condition is met,
236
- # the action in that policy will execute.
237
- # If there are multiple policies that the task execution result matches,
238
- # we use the action from the first matched policy. If task execution result
239
- # does not meet with any of the defined lifecycle policy, we consider it as
240
- # the default policy. Default policy means if the exit code is 0, exit task.
267
+ # Currently we only support one lifecycle policy.
268
+ # When the lifecycle policy condition is met,
269
+ # the action in the policy will execute.
270
+ # If task execution result does not meet with the defined lifecycle
271
+ # policy, we consider it as the default policy.
272
+ # Default policy means if the exit code is 0, exit task.
241
273
  # If task ends with non-zero exit code, retry the task with max_retry_count.
242
274
  # @!attribute [rw] environments
243
275
  # @return [::Google::Protobuf::Map{::String => ::String}]
@@ -267,6 +299,10 @@ module Google
267
299
  # @!attribute [rw] action
268
300
  # @return [::Google::Cloud::Batch::V1::LifecyclePolicy::Action]
269
301
  # Action to execute when ActionCondition is true.
302
+ # When RETRY_TASK is specified, we will retry failed tasks
303
+ # if we notice any exit code match and fail tasks if no match is found.
304
+ # Likewise, when FAIL_TASK is specified, we will fail tasks
305
+ # if we notice any exit code match and retry tasks if no match is found.
270
306
  # @!attribute [rw] action_condition
271
307
  # @return [::Google::Cloud::Batch::V1::LifecyclePolicy::ActionCondition]
272
308
  # Conditions that decide why a task failure is dealt with a specific action.
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Iam
22
+ module V1
23
+ # Request message for `SetIamPolicy` method.
24
+ # @!attribute [rw] resource
25
+ # @return [::String]
26
+ # REQUIRED: The resource for which the policy is being specified.
27
+ # See the operation documentation for the appropriate value for this field.
28
+ # @!attribute [rw] policy
29
+ # @return [::Google::Iam::V1::Policy]
30
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
31
+ # the policy is limited to a few 10s of KB. An empty policy is a
32
+ # valid policy but certain Cloud Platform services (such as Projects)
33
+ # might reject them.
34
+ # @!attribute [rw] update_mask
35
+ # @return [::Google::Protobuf::FieldMask]
36
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
37
+ # the fields in the mask will be modified. If no mask is provided, the
38
+ # following default mask is used:
39
+ #
40
+ # `paths: "bindings, etag"`
41
+ class SetIamPolicyRequest
42
+ include ::Google::Protobuf::MessageExts
43
+ extend ::Google::Protobuf::MessageExts::ClassMethods
44
+ end
45
+
46
+ # Request message for `GetIamPolicy` method.
47
+ # @!attribute [rw] resource
48
+ # @return [::String]
49
+ # REQUIRED: The resource for which the policy is being requested.
50
+ # See the operation documentation for the appropriate value for this field.
51
+ # @!attribute [rw] options
52
+ # @return [::Google::Iam::V1::GetPolicyOptions]
53
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
54
+ # `GetIamPolicy`.
55
+ class GetIamPolicyRequest
56
+ include ::Google::Protobuf::MessageExts
57
+ extend ::Google::Protobuf::MessageExts::ClassMethods
58
+ end
59
+
60
+ # Request message for `TestIamPermissions` method.
61
+ # @!attribute [rw] resource
62
+ # @return [::String]
63
+ # REQUIRED: The resource for which the policy detail is being requested.
64
+ # See the operation documentation for the appropriate value for this field.
65
+ # @!attribute [rw] permissions
66
+ # @return [::Array<::String>]
67
+ # The set of permissions to check for the `resource`. Permissions with
68
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
69
+ # information see
70
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
71
+ class TestIamPermissionsRequest
72
+ include ::Google::Protobuf::MessageExts
73
+ extend ::Google::Protobuf::MessageExts::ClassMethods
74
+ end
75
+
76
+ # Response message for `TestIamPermissions` method.
77
+ # @!attribute [rw] permissions
78
+ # @return [::Array<::String>]
79
+ # A subset of `TestPermissionsRequest.permissions` that the caller is
80
+ # allowed.
81
+ class TestIamPermissionsResponse
82
+ include ::Google::Protobuf::MessageExts
83
+ extend ::Google::Protobuf::MessageExts::ClassMethods
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Iam
22
+ module V1
23
+ # Encapsulates settings provided to GetIamPolicy.
24
+ # @!attribute [rw] requested_policy_version
25
+ # @return [::Integer]
26
+ # Optional. The maximum policy version that will be used to format the
27
+ # policy.
28
+ #
29
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
30
+ # rejected.
31
+ #
32
+ # Requests for policies with any conditional role bindings must specify
33
+ # version 3. Policies with no conditional role bindings may specify any valid
34
+ # value or leave the field unset.
35
+ #
36
+ # The policy in the response might use the policy version that you specified,
37
+ # or it might use a lower policy version. For example, if you specify version
38
+ # 3, but the policy has no conditional role bindings, the response uses
39
+ # version 1.
40
+ #
41
+ # To learn which resources support conditions in their IAM policies, see the
42
+ # [IAM
43
+ # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
44
+ class GetPolicyOptions
45
+ include ::Google::Protobuf::MessageExts
46
+ extend ::Google::Protobuf::MessageExts::ClassMethods
47
+ end
48
+ end
49
+ end
50
+ end