google-cloud-batch-v1 0.1.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 +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +141 -0
  6. data/lib/google/cloud/batch/v1/batch_pb.rb +84 -0
  7. data/lib/google/cloud/batch/v1/batch_service/client.rb +994 -0
  8. data/lib/google/cloud/batch/v1/batch_service/credentials.rb +47 -0
  9. data/lib/google/cloud/batch/v1/batch_service/operations.rb +767 -0
  10. data/lib/google/cloud/batch/v1/batch_service/paths.rb +113 -0
  11. data/lib/google/cloud/batch/v1/batch_service.rb +52 -0
  12. data/lib/google/cloud/batch/v1/batch_services_pb.rb +57 -0
  13. data/lib/google/cloud/batch/v1/job_pb.rb +170 -0
  14. data/lib/google/cloud/batch/v1/task_pb.rb +121 -0
  15. data/lib/google/cloud/batch/v1/version.rb +28 -0
  16. data/lib/google/cloud/batch/v1/volume_pb.rb +37 -0
  17. data/lib/google/cloud/batch/v1.rb +40 -0
  18. data/lib/google-cloud-batch-v1.rb +21 -0
  19. data/proto_docs/README.md +4 -0
  20. data/proto_docs/google/api/field_behavior.rb +71 -0
  21. data/proto_docs/google/api/resource.rb +222 -0
  22. data/proto_docs/google/cloud/batch/v1/batch.rb +209 -0
  23. data/proto_docs/google/cloud/batch/v1/job.rb +490 -0
  24. data/proto_docs/google/cloud/batch/v1/task.rb +329 -0
  25. data/proto_docs/google/cloud/batch/v1/volume.rb +78 -0
  26. data/proto_docs/google/longrunning/operations.rb +164 -0
  27. data/proto_docs/google/protobuf/any.rb +141 -0
  28. data/proto_docs/google/protobuf/duration.rb +98 -0
  29. data/proto_docs/google/protobuf/empty.rb +36 -0
  30. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  31. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  32. data/proto_docs/google/rpc/status.rb +46 -0
  33. data/proto_docs/google/type/expr.rb +75 -0
  34. metadata +266 -0
@@ -0,0 +1,490 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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 Cloud
22
+ module Batch
23
+ module V1
24
+ # The Cloud Batch Job description.
25
+ # @!attribute [r] name
26
+ # @return [::String]
27
+ # Output only. Job name.
28
+ # For example: "projects/123456/locations/us-central1/jobs/job01".
29
+ # @!attribute [r] uid
30
+ # @return [::String]
31
+ # Output only. A system generated unique ID (in UUID4 format) for the Job.
32
+ # @!attribute [rw] priority
33
+ # @return [::Integer]
34
+ # Priority of the Job.
35
+ # The valid value range is [0, 100).
36
+ # A job with higher priority value is more likely to run earlier if all other
37
+ # requirements are satisfied.
38
+ # @!attribute [rw] task_groups
39
+ # @return [::Array<::Google::Cloud::Batch::V1::TaskGroup>]
40
+ # Required. TaskGroups in the Job. Only one TaskGroup is supported now.
41
+ # @!attribute [rw] allocation_policy
42
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy]
43
+ # Compute resource allocation for all TaskGroups in the Job.
44
+ # @!attribute [rw] labels
45
+ # @return [::Google::Protobuf::Map{::String => ::String}]
46
+ # Labels for the Job. Labels could be user provided or system generated.
47
+ # For example,
48
+ # "labels": {
49
+ # "department": "finance",
50
+ # "environment": "test"
51
+ # }
52
+ # You can assign up to 64 labels. [Google Compute Engine label
53
+ # restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
54
+ # apply.
55
+ # Label names that start with "goog-" or "google-" are reserved.
56
+ # @!attribute [r] status
57
+ # @return [::Google::Cloud::Batch::V1::JobStatus]
58
+ # Output only. Job status. It is read only for users.
59
+ # @!attribute [r] create_time
60
+ # @return [::Google::Protobuf::Timestamp]
61
+ # Output only. When the Job was created.
62
+ # @!attribute [r] update_time
63
+ # @return [::Google::Protobuf::Timestamp]
64
+ # Output only. The last time the Job was updated.
65
+ # @!attribute [rw] logs_policy
66
+ # @return [::Google::Cloud::Batch::V1::LogsPolicy]
67
+ # Log preservation policy for the Job.
68
+ # @!attribute [rw] notifications
69
+ # @return [::Array<::Google::Cloud::Batch::V1::JobNotification>]
70
+ # Notification configurations.
71
+ class Job
72
+ include ::Google::Protobuf::MessageExts
73
+ extend ::Google::Protobuf::MessageExts::ClassMethods
74
+
75
+ # @!attribute [rw] key
76
+ # @return [::String]
77
+ # @!attribute [rw] value
78
+ # @return [::String]
79
+ class LabelsEntry
80
+ include ::Google::Protobuf::MessageExts
81
+ extend ::Google::Protobuf::MessageExts::ClassMethods
82
+ end
83
+ end
84
+
85
+ # LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be
86
+ # preserved.
87
+ # @!attribute [rw] destination
88
+ # @return [::Google::Cloud::Batch::V1::LogsPolicy::Destination]
89
+ # Where logs should be saved.
90
+ # @!attribute [rw] logs_path
91
+ # @return [::String]
92
+ # The path to which logs are saved when the destination = PATH. This can be a
93
+ # local file path on the VM, or under the mount point of a Persistent Disk or
94
+ # Filestore, or a Cloud Storage path.
95
+ class LogsPolicy
96
+ include ::Google::Protobuf::MessageExts
97
+ extend ::Google::Protobuf::MessageExts::ClassMethods
98
+
99
+ # The destination (if any) for logs.
100
+ module Destination
101
+ # Logs are not preserved.
102
+ DESTINATION_UNSPECIFIED = 0
103
+
104
+ # Logs are streamed to Cloud Logging.
105
+ CLOUD_LOGGING = 1
106
+
107
+ # Logs are saved to a file path.
108
+ PATH = 2
109
+ end
110
+ end
111
+
112
+ # Job status.
113
+ # @!attribute [rw] state
114
+ # @return [::Google::Cloud::Batch::V1::JobStatus::State]
115
+ # Job state
116
+ # @!attribute [rw] status_events
117
+ # @return [::Array<::Google::Cloud::Batch::V1::StatusEvent>]
118
+ # Job status events
119
+ # @!attribute [rw] task_groups
120
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Batch::V1::JobStatus::TaskGroupStatus}]
121
+ # Aggregated task status for each TaskGroup in the Job.
122
+ # The map key is TaskGroup ID.
123
+ # @!attribute [rw] run_duration
124
+ # @return [::Google::Protobuf::Duration]
125
+ # The duration of time that the Job spent in status RUNNING.
126
+ class JobStatus
127
+ include ::Google::Protobuf::MessageExts
128
+ extend ::Google::Protobuf::MessageExts::ClassMethods
129
+
130
+ # VM instance status.
131
+ # @!attribute [rw] machine_type
132
+ # @return [::String]
133
+ # The Compute Engine machine type.
134
+ # @!attribute [rw] provisioning_model
135
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
136
+ # The VM instance provisioning model.
137
+ # @!attribute [rw] task_pack
138
+ # @return [::Integer]
139
+ # The max number of tasks can be assigned to this instance type.
140
+ class InstanceStatus
141
+ include ::Google::Protobuf::MessageExts
142
+ extend ::Google::Protobuf::MessageExts::ClassMethods
143
+ end
144
+
145
+ # Aggregated task status for a TaskGroup.
146
+ # @!attribute [rw] counts
147
+ # @return [::Google::Protobuf::Map{::String => ::Integer}]
148
+ # Count of task in each state in the TaskGroup.
149
+ # The map key is task state name.
150
+ # @!attribute [rw] instances
151
+ # @return [::Array<::Google::Cloud::Batch::V1::JobStatus::InstanceStatus>]
152
+ # Status of instances allocated for the TaskGroup.
153
+ class TaskGroupStatus
154
+ include ::Google::Protobuf::MessageExts
155
+ extend ::Google::Protobuf::MessageExts::ClassMethods
156
+
157
+ # @!attribute [rw] key
158
+ # @return [::String]
159
+ # @!attribute [rw] value
160
+ # @return [::Integer]
161
+ class CountsEntry
162
+ include ::Google::Protobuf::MessageExts
163
+ extend ::Google::Protobuf::MessageExts::ClassMethods
164
+ end
165
+ end
166
+
167
+ # @!attribute [rw] key
168
+ # @return [::String]
169
+ # @!attribute [rw] value
170
+ # @return [::Google::Cloud::Batch::V1::JobStatus::TaskGroupStatus]
171
+ class TaskGroupsEntry
172
+ include ::Google::Protobuf::MessageExts
173
+ extend ::Google::Protobuf::MessageExts::ClassMethods
174
+ end
175
+
176
+ # Valid Job states.
177
+ module State
178
+ STATE_UNSPECIFIED = 0
179
+
180
+ # Job is admitted (validated and persisted) and waiting for resources.
181
+ QUEUED = 1
182
+
183
+ # Job is scheduled to run as soon as resource allocation is ready.
184
+ # The resource allocation may happen at a later time but with a high
185
+ # chance to succeed.
186
+ SCHEDULED = 2
187
+
188
+ # Resource allocation has been successful. At least one Task in the Job is
189
+ # RUNNING.
190
+ RUNNING = 3
191
+
192
+ # All Tasks in the Job have finished successfully.
193
+ SUCCEEDED = 4
194
+
195
+ # At least one Task in the Job has failed.
196
+ FAILED = 5
197
+
198
+ # The Job will be deleted, but has not been deleted yet. Typically this is
199
+ # because resources used by the Job are still being cleaned up.
200
+ DELETION_IN_PROGRESS = 6
201
+ end
202
+ end
203
+
204
+ # Notification configurations.
205
+ # @!attribute [rw] pubsub_topic
206
+ # @return [::String]
207
+ # The Pub/Sub topic where notifications like the job state changes
208
+ # will be published. This topic exist in the same project as the job
209
+ # and billings will be charged to this project.
210
+ # If not specified, no Pub/Sub messages will be sent.
211
+ # Topic format: `projects/{project}/topics/{topic}`.
212
+ # @!attribute [rw] message
213
+ # @return [::Google::Cloud::Batch::V1::JobNotification::Message]
214
+ # The attribute requirements of messages to be sent to this Pub/Sub topic.
215
+ # Without this field, no message will be sent.
216
+ class JobNotification
217
+ include ::Google::Protobuf::MessageExts
218
+ extend ::Google::Protobuf::MessageExts::ClassMethods
219
+
220
+ # Message details.
221
+ # Describe the attribute that a message should have.
222
+ # Without specified message attributes, no message will be sent by default.
223
+ # @!attribute [rw] type
224
+ # @return [::Google::Cloud::Batch::V1::JobNotification::Type]
225
+ # The message type.
226
+ # @!attribute [rw] new_job_state
227
+ # @return [::Google::Cloud::Batch::V1::JobStatus::State]
228
+ # The new job state.
229
+ # @!attribute [rw] new_task_state
230
+ # @return [::Google::Cloud::Batch::V1::TaskStatus::State]
231
+ # The new task state.
232
+ class Message
233
+ include ::Google::Protobuf::MessageExts
234
+ extend ::Google::Protobuf::MessageExts::ClassMethods
235
+ end
236
+
237
+ # The message type.
238
+ module Type
239
+ # Unspecified.
240
+ TYPE_UNSPECIFIED = 0
241
+
242
+ # Notify users that the job state has changed.
243
+ JOB_STATE_CHANGED = 1
244
+
245
+ # Notify users that the task state has changed.
246
+ TASK_STATE_CHANGED = 2
247
+ end
248
+ end
249
+
250
+ # A Job's resource allocation policy describes when, where, and how compute
251
+ # resources should be allocated for the Job.
252
+ # @!attribute [rw] location
253
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::LocationPolicy]
254
+ # Location where compute resources should be allocated for the Job.
255
+ # @!attribute [rw] instances
256
+ # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicyOrTemplate>]
257
+ # Describe instances that can be created by this AllocationPolicy.
258
+ # Only instances[0] is supported now.
259
+ # @!attribute [rw] labels
260
+ # @return [::Google::Protobuf::Map{::String => ::String}]
261
+ # Labels applied to all VM instances and other resources
262
+ # created by AllocationPolicy.
263
+ # Labels could be user provided or system generated.
264
+ # You can assign up to 64 labels. [Google Compute Engine label
265
+ # restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
266
+ # apply.
267
+ # Label names that start with "goog-" or "google-" are reserved.
268
+ # @!attribute [rw] network
269
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::NetworkPolicy]
270
+ # The network policy.
271
+ class AllocationPolicy
272
+ include ::Google::Protobuf::MessageExts
273
+ extend ::Google::Protobuf::MessageExts::ClassMethods
274
+
275
+ # @!attribute [rw] allowed_locations
276
+ # @return [::Array<::String>]
277
+ # A list of allowed location names represented by internal URLs,
278
+ # First location in the list must be a region.
279
+ # for example,
280
+ # ["regions/us-central1"] allow VMs in region us-central1,
281
+ # ["regions/us-central1", "zones/us-central1-a"] only allow VMs in zone
282
+ # us-central1-a.
283
+ class LocationPolicy
284
+ include ::Google::Protobuf::MessageExts
285
+ extend ::Google::Protobuf::MessageExts::ClassMethods
286
+ end
287
+
288
+ # A new persistent disk.
289
+ # @!attribute [rw] image
290
+ # @return [::String]
291
+ # Name of a public or custom image used as the data source.
292
+ # @!attribute [rw] snapshot
293
+ # @return [::String]
294
+ # Name of a snapshot used as the data source.
295
+ # @!attribute [rw] type
296
+ # @return [::String]
297
+ # Disk type as shown in `gcloud compute disk-types list`
298
+ # For example, "pd-ssd", "pd-standard", "pd-balanced".
299
+ # @!attribute [rw] size_gb
300
+ # @return [::Integer]
301
+ # Disk size in GB.
302
+ # This field is ignored if `data_source` is `disk` or `image`.
303
+ class Disk
304
+ include ::Google::Protobuf::MessageExts
305
+ extend ::Google::Protobuf::MessageExts::ClassMethods
306
+ end
307
+
308
+ # A new or an existing persistent disk attached to a VM instance.
309
+ # @!attribute [rw] new_disk
310
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
311
+ # @!attribute [rw] existing_disk
312
+ # @return [::String]
313
+ # Name of an existing PD.
314
+ # @!attribute [rw] device_name
315
+ # @return [::String]
316
+ # Device name that the guest operating system will see.
317
+ # If not specified, this is default to the disk name.
318
+ class AttachedDisk
319
+ include ::Google::Protobuf::MessageExts
320
+ extend ::Google::Protobuf::MessageExts::ClassMethods
321
+ end
322
+
323
+ # Accelerator describes Compute Engine accelerators to be attached to VMs.
324
+ # @!attribute [rw] type
325
+ # @return [::String]
326
+ # The accelerator type. For example, "nvidia-tesla-t4".
327
+ # See `gcloud compute accelerator-types list`.
328
+ # @!attribute [rw] count
329
+ # @return [::Integer]
330
+ # The number of accelerators of this type.
331
+ class Accelerator
332
+ include ::Google::Protobuf::MessageExts
333
+ extend ::Google::Protobuf::MessageExts::ClassMethods
334
+ end
335
+
336
+ # InstancePolicy describes an instance type and resources attached to each VM
337
+ # created by this InstancePolicy.
338
+ # @!attribute [rw] machine_type
339
+ # @return [::String]
340
+ # The Compute Engine machine type.
341
+ # @!attribute [rw] min_cpu_platform
342
+ # @return [::String]
343
+ # The minimum CPU platform.
344
+ # See
345
+ # `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
346
+ # Not yet implemented.
347
+ # @!attribute [rw] provisioning_model
348
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
349
+ # The provisioning model.
350
+ # @!attribute [rw] accelerators
351
+ # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
352
+ # The accelerators attached to each VM instance.
353
+ # Not yet implemented.
354
+ # @!attribute [rw] disks
355
+ # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
356
+ # Non-boot disks to be attached for each VM created by this InstancePolicy.
357
+ # New disks will be deleted when the attached VM is deleted.
358
+ class InstancePolicy
359
+ include ::Google::Protobuf::MessageExts
360
+ extend ::Google::Protobuf::MessageExts::ClassMethods
361
+ end
362
+
363
+ # Either an InstancePolicy or an instance template.
364
+ # @!attribute [rw] policy
365
+ # @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
366
+ # InstancePolicy.
367
+ # @!attribute [rw] instance_template
368
+ # @return [::String]
369
+ # Name of an instance template used to create VMs.
370
+ # Named the field as 'instance_template' instead of 'template' to avoid
371
+ # c++ keyword conflict.
372
+ class InstancePolicyOrTemplate
373
+ include ::Google::Protobuf::MessageExts
374
+ extend ::Google::Protobuf::MessageExts::ClassMethods
375
+ end
376
+
377
+ # A network interface.
378
+ # @!attribute [rw] network
379
+ # @return [::String]
380
+ # The URL of the network resource.
381
+ # @!attribute [rw] subnetwork
382
+ # @return [::String]
383
+ # The URL of the Subnetwork resource.
384
+ # @!attribute [rw] no_external_ip_address
385
+ # @return [::Boolean]
386
+ # Default is false (with an external IP address). Required if
387
+ # no external public IP address is attached to the VM. If no external
388
+ # public IP address, additional configuration is required to allow the VM
389
+ # to access Google Services. See
390
+ # https://cloud.google.com/vpc/docs/configure-private-google-access and
391
+ # https://cloud.google.com/nat/docs/gce-example#create-nat for more
392
+ # information.
393
+ class NetworkInterface
394
+ include ::Google::Protobuf::MessageExts
395
+ extend ::Google::Protobuf::MessageExts::ClassMethods
396
+ end
397
+
398
+ # NetworkPolicy describes VM instance network configurations.
399
+ # @!attribute [rw] network_interfaces
400
+ # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
401
+ # Network configurations.
402
+ class NetworkPolicy
403
+ include ::Google::Protobuf::MessageExts
404
+ extend ::Google::Protobuf::MessageExts::ClassMethods
405
+ end
406
+
407
+ # @!attribute [rw] key
408
+ # @return [::String]
409
+ # @!attribute [rw] value
410
+ # @return [::String]
411
+ class LabelsEntry
412
+ include ::Google::Protobuf::MessageExts
413
+ extend ::Google::Protobuf::MessageExts::ClassMethods
414
+ end
415
+
416
+ # Compute Engine VM instance provisioning model.
417
+ module ProvisioningModel
418
+ # Unspecified.
419
+ PROVISIONING_MODEL_UNSPECIFIED = 0
420
+
421
+ # Standard VM.
422
+ STANDARD = 1
423
+
424
+ # SPOT VM.
425
+ SPOT = 2
426
+
427
+ # Preemptible VM (PVM).
428
+ #
429
+ # Above SPOT VM is the preferable model for preemptible VM instances: the
430
+ # old preemptible VM model (indicated by this field) is the older model,
431
+ # and has been migrated to use the SPOT model as the underlying technology.
432
+ # This old model will still be supported.
433
+ PREEMPTIBLE = 3
434
+ end
435
+ end
436
+
437
+ # A TaskGroup contains one or multiple Tasks that share the same
438
+ # Runnable but with different runtime parameters.
439
+ # @!attribute [r] name
440
+ # @return [::String]
441
+ # Output only. TaskGroup name.
442
+ # The system generates this field based on parent Job name.
443
+ # For example:
444
+ # "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
445
+ # @!attribute [rw] task_spec
446
+ # @return [::Google::Cloud::Batch::V1::TaskSpec]
447
+ # Required. Tasks in the group share the same task spec.
448
+ # @!attribute [rw] task_count
449
+ # @return [::Integer]
450
+ # Number of Tasks in the TaskGroup.
451
+ # default is 1
452
+ # @!attribute [rw] parallelism
453
+ # @return [::Integer]
454
+ # Max number of tasks that can run in parallel.
455
+ # Default to min(task_count, 1000).
456
+ # @!attribute [rw] task_environments
457
+ # @return [::Array<::Google::Cloud::Batch::V1::Environment>]
458
+ # An array of environment variable mappings, which are passed to Tasks with
459
+ # matching indices. If task_environments is used then task_count should
460
+ # not be specified in the request (and will be ignored). Task count will be
461
+ # the length of task_environments.
462
+ #
463
+ # Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in
464
+ # addition to any environment variables set in task_environments, specifying
465
+ # the number of Tasks in the Task's parent TaskGroup, and the specific Task's
466
+ # index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
467
+ #
468
+ # task_environments supports up to 200 entries.
469
+ # @!attribute [rw] task_count_per_node
470
+ # @return [::Integer]
471
+ # Max number of tasks that can be run on a VM at the same time.
472
+ # If not specified, the system will decide a value based on available
473
+ # compute resources on a VM and task requirements.
474
+ # @!attribute [rw] require_hosts_file
475
+ # @return [::Boolean]
476
+ # When true, Batch will populate a file with a list of all VMs assigned to
477
+ # the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path
478
+ # of that file. Defaults to false.
479
+ # @!attribute [rw] permissive_ssh
480
+ # @return [::Boolean]
481
+ # When true, Batch will configure SSH to allow passwordless login between
482
+ # VMs running the Batch tasks in the same TaskGroup.
483
+ class TaskGroup
484
+ include ::Google::Protobuf::MessageExts
485
+ extend ::Google::Protobuf::MessageExts::ClassMethods
486
+ end
487
+ end
488
+ end
489
+ end
490
+ end