Class: Google::Cloud::Batch::V1::AllocationPolicy

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/batch/v1/job.rb

Overview

A Job's resource allocation policy describes when, where, and how compute resources should be allocated for the Job.

Defined Under Namespace

Modules: ProvisioningModel Classes: Accelerator, AttachedDisk, Disk, InstancePolicy, InstancePolicyOrTemplate, LabelsEntry, LocationPolicy, NetworkInterface, NetworkPolicy

Instance Attribute Summary collapse

Instance Attribute Details

#instances::Array<::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicyOrTemplate>

Returns Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

Returns:



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 274

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["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.
  #     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.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # https://cloud.google.com/compute/docs/disks#pdspecs.
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`
  #     For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #     This field is ignored if `data_source` is `disk` or `image`.
  #     If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of the network resource.
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of the Subnetwork resource.
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#labels::Google::Protobuf::Map{::String => ::String}

Returns Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided or system generated. You can assign up to 64 labels. Google Compute Engine label restrictions apply. Label names that start with "goog-" or "google-" are reserved.

Returns:

  • (::Google::Protobuf::Map{::String => ::String})

    Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided or system generated. You can assign up to 64 labels. Google Compute Engine label restrictions apply. Label names that start with "goog-" or "google-" are reserved.



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 274

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["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.
  #     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.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # https://cloud.google.com/compute/docs/disks#pdspecs.
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`
  #     For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #     This field is ignored if `data_source` is `disk` or `image`.
  #     If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of the network resource.
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of the Subnetwork resource.
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#location::Google::Cloud::Batch::V1::AllocationPolicy::LocationPolicy

Returns Location where compute resources should be allocated for the Job.

Returns:



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 274

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["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.
  #     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.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # https://cloud.google.com/compute/docs/disks#pdspecs.
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`
  #     For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #     This field is ignored if `data_source` is `disk` or `image`.
  #     If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of the network resource.
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of the Subnetwork resource.
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#network::Google::Cloud::Batch::V1::AllocationPolicy::NetworkPolicy

Returns The network policy.



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 274

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["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.
  #     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.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # https://cloud.google.com/compute/docs/disks#pdspecs.
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`
  #     For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #     This field is ignored if `data_source` is `disk` or `image`.
  #     If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of the network resource.
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of the Subnetwork resource.
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#service_account::Google::Cloud::Batch::V1::ServiceAccount

Returns Service account that VMs will run as.

Returns:



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 274

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["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.
  #     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.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # https://cloud.google.com/compute/docs/disks#pdspecs.
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`
  #     For example, "pd-ssd", "pd-standard", "pd-balanced", "local-ssd".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #     This field is ignored if `data_source` is `disk` or `image`.
  #     If `type` is `local-ssd`, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of the network resource.
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of the Subnetwork resource.
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end