NAME
Google::Cloud::Batch::V1alpha::Job - Compiled Protocol Buffers messages for google/cloud/batch/v1alpha/job.proto
SYNOPSIS
use Google::Cloud::Batch::V1alpha::Job;
my $msg = Google::Cloud::Batch::V1alpha::Job::Job->new({
name => $name,
uid => $uid,
priority => $priority,
task_groups => $task_groups,
});
# Read or update a field
my $val = $msg->name();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Cloud::Batch::V1alpha::Job::Job->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/batch/v1alpha/job.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Cloud::Batch::V1alpha::Job::Job
The Cloud Batch Job description.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringOutput only. Job name. For example: "projects/123456/locations/us-central1/jobs/job01".
$msg->uid()/$msg->uid($value)Type:
StringOutput only. A system generated unique ID for the Job.
$msg->priority()/$msg->priority($value)Type:
Int64Priority of the Job. The valid value range is [0, 100). Default value is 0. Higher value indicates higher priority. A job with higher priority value is more likely to run earlier if all other requirements are satisfied.
$msg->task_groups()/$msg->task_groups($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::TaskGroup)Required. TaskGroups in the Job. Only one TaskGroup is supported now.
$msg->scheduling_policy()/$msg->scheduling_policy($value)Type:
Enum(Google::Cloud::Batch::V1alpha::Job::SchedulingPolicy)Scheduling policy for TaskGroups in the job.
$msg->dependencies()/$msg->dependencies($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::JobDependency)At least one of the dependencies must be satisfied before the Job is scheduled to run. Only one JobDependency is supported now. Not yet implemented.
$msg->allocation_policy()/$msg->allocation_policy($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy)Compute resource allocation for all TaskGroups in the Job.
$msg->labels()/$msg->labels($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::Job::LabelsEntry)Custom labels to apply to the job and any Cloud Logging [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) that it generates.
Use labels to group and describe the resources they are applied to. Batch automatically applies predefined labels and supports multiple `labels` fields for each job, which each let you apply custom labels to various resources. Label names that start with "goog-" or "google-" are reserved for predefined labels. For more information about labels with Batch, see [Organize resources using labels](https://cloud.google.com/batch/docs/organize-resources-using-labels).
$msg->status()/$msg->status($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::JobStatus)Output only. Job status. It is read only for users.
$msg->notification()/$msg->notification($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::JobNotification)Deprecated: please use notifications instead.
$msg->create_time()/$msg->create_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)Output only. When the Job was created.
$msg->update_time()/$msg->update_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)Output only. The last time the Job was updated.
$msg->logs_policy()/$msg->logs_policy($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::LogsPolicy)Log preservation policy for the Job.
$msg->notifications()/$msg->notifications($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::JobNotification)Notification configurations.
Enum: Job::SchedulingPolicy
SCHEDULING_POLICY_UNSPECIFIED=>0AS_SOON_AS_POSSIBLE=>1
Google::Cloud::Batch::V1alpha::Job::LogsPolicy
LogsPolicy describes if and how a job's logs are preserved. Logs include information that is automatically written by the Batch service agent and any information that you configured the job's runnables to write to the `stdout` or `stderr` streams.
Inherits from Protobuf::Message.
Accessors
$msg->destination()/$msg->destination($value)Type:
Enum(Google::Cloud::Batch::V1alpha::LogsPolicy::Destination)If and where logs should be saved.
$msg->logs_path()/$msg->logs_path($value)Type:
StringWhen `destination` is set to `PATH`, you must set this field to the path where you want logs to be saved. This path can point to a local directory on the VM or (if congifured) a directory under the mount path of any Cloud Storage bucket, network file system (NFS), or writable persistent disk that is mounted to the job. For example, if the job has a bucket with `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the root directory of the `remotePath` of that bucket by setting this field to `/mnt/disks/my-bucket/`.
$msg->cloud_logging_option()/$msg->cloud_logging_option($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::LogsPolicy::CloudLoggingOption)Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally set this field to configure additional settings for Cloud Logging.
Enum: LogsPolicy::Destination
DESTINATION_UNSPECIFIED=>0CLOUD_LOGGING=>1PATH=>2
Google::Cloud::Batch::V1alpha::Job::JobDependency
JobDependency describes the state of other Jobs that the start of this Job depends on. All dependent Jobs must have been submitted in the same region.
Inherits from Protobuf::Message.
Accessors
$msg->items()/$msg->items($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::JobDependency::ItemsEntry)Each item maps a Job name to a Type. All items must be satisfied for the JobDependency to be satisfied (the AND operation). Once a condition for one item becomes true, it won't go back to false even the dependent Job state changes again.
Enum: JobDependency::Type
TYPE_UNSPECIFIED=>0SUCCEEDED=>1FAILED=>2FINISHED=>3
Google::Cloud::Batch::V1alpha::Job::JobStatus
Job status.
Inherits from Protobuf::Message.
Accessors
$msg->state()/$msg->state($value)Type:
Enum(Google::Cloud::Batch::V1alpha::JobStatus::State)Job state
$msg->status_events()/$msg->status_events($value)Type:
Message(Google::Cloud::Batch::V1alpha::Task::StatusEvent)Job status events
$msg->task_groups()/$msg->task_groups($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::JobStatus::TaskGroupsEntry)Aggregated task status for each TaskGroup in the Job. The map key is TaskGroup ID.
$msg->run_duration()/$msg->run_duration($value)Type:
Message(Google::Protobuf::Duration::Duration)The duration of time that the Job spent in status RUNNING.
$msg->resource_usage()/$msg->resource_usage($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::ResourceUsage)The resource usage of the job.
Enum: JobStatus::State
STATE_UNSPECIFIED=>0QUEUED=>1SCHEDULED=>2RUNNING=>3SUCCEEDED=>4FAILED=>5DELETION_IN_PROGRESS=>6CANCELLATION_IN_PROGRESS=>7CANCELLED=>8
Google::Cloud::Batch::V1alpha::Job::ResourceUsage
ResourceUsage describes the resource usage of the job.
Inherits from Protobuf::Message.
Accessors
$msg->core_hours()/$msg->core_hours($value)Type:
DoubleThe CPU core hours that the job consumes.
Google::Cloud::Batch::V1alpha::Job::JobNotification
Notification configurations.
Inherits from Protobuf::Message.
Accessors
$msg->pubsub_topic()/$msg->pubsub_topic($value)Type:
StringThe Pub/Sub topic where notifications for the job, like state changes, will be published. If undefined, no Pub/Sub notifications are sent for this job.
Specify the topic using the following format: `projects/{project}/topics/{topic}`. Notably, if you want to specify a Pub/Sub topic that is in a different project than the job, your administrator must grant your project's Batch service agent permission to publish to that topic.
For more information about configuring Pub/Sub notifications for a job, see https://cloud.google.com/batch/docs/enable-notifications.
$msg->message()/$msg->message($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::JobNotification::Message)The attribute requirements of messages to be sent to this Pub/Sub topic. Without this field, no message will be sent.
Enum: JobNotification::Type
TYPE_UNSPECIFIED=>0JOB_STATE_CHANGED=>1TASK_STATE_CHANGED=>2
Google::Cloud::Batch::V1alpha::Job::AllocationPolicy
A Job's resource allocation policy describes when, where, and how compute resources should be allocated for the Job.
Inherits from Protobuf::Message.
Accessors
$msg->location()/$msg->location($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy::LocationPolicy)Location where compute resources should be allocated for the Job.
$msg->instance()/$msg->instance($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy::InstancePolicy)Deprecated: please use instances[0].policy instead.
$msg->instances()/$msg->instances($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy::InstancePolicyOrTemplate)Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.
$msg->instance_templates()/$msg->instance_templates($value)Type:
StringDeprecated: please use instances[0].template instead.
$msg->provisioning_models()/$msg->provisioning_models($value)Type:
Enum(Google::Cloud::Batch::V1alpha::AllocationPolicy::ProvisioningModel)Deprecated: please use instances[0].policy.provisioning_model instead.
$msg->service_account_email()/$msg->service_account_email($value)Type:
StringDeprecated: please use service_account instead.
$msg->service_account()/$msg->service_account($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::ServiceAccount)Defines the service account for Batch-created VMs. If omitted, the [default Compute Engine service account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) is used. Must match the service account specified in any used instance template configured in the Batch job.
Includes the following fields: * email: The service account's email address. If not set, the default Compute Engine service account is used. * scopes: Additional OAuth scopes to grant the service account, beyond the default cloud-platform scope. (list of strings)
$msg->labels()/$msg->labels($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy::LabelsEntry)Custom labels to apply to the job and all the Compute Engine resources that both are created by this allocation policy and support labels.
Use labels to group and describe the resources they are applied to. Batch automatically applies predefined labels and supports multiple `labels` fields for each job, which each let you apply custom labels to various resources. Label names that start with "goog-" or "google-" are reserved for predefined labels. For more information about labels with Batch, see [Organize resources using labels](https://cloud.google.com/batch/docs/organize-resources-using-labels).
$msg->network()/$msg->network($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy::NetworkPolicy)The network policy.
If you define an instance template in the `InstancePolicyOrTemplate` field, Batch will use the network settings in the instance template instead of this field.
$msg->placement()/$msg->placement($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy::PlacementPolicy)The placement policy.
$msg->tags()/$msg->tags($value)Type:
StringOptional. Tags applied to the VM instances.
The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
$msg->instance_flexibility_policy()/$msg->instance_flexibility_policy($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy::InstanceFlexibilityPolicy)Optional. The instance flexibility policy for the job. This configuration overrides the `instances` configuration. Only allowed in job level. Not allowed in task group level.
Enum: AllocationPolicy::ProvisioningModel
PROVISIONING_MODEL_UNSPECIFIED=>0STANDARD=>1SPOT=>2PREEMPTIBLE=>3RESERVATION_BOUND=>4FLEX_START=>5
Google::Cloud::Batch::V1alpha::Job::TaskGroup
A TaskGroup defines one or more Tasks that all share the same TaskSpec.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringOutput only. TaskGroup name. The system generates this field based on parent Job name. For example: "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
$msg->task_spec()/$msg->task_spec($value)Type:
Message(Google::Cloud::Batch::V1alpha::Task::TaskSpec)Required. Tasks in the group share the same task spec.
$msg->task_count()/$msg->task_count($value)Type:
Int64Number of Tasks in the TaskGroup. Default is 1.
$msg->parallelism()/$msg->parallelism($value)Type:
Int64Max number of tasks that can run in parallel. Default to min(task_count, parallel tasks per job limit). See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
$msg->scheduling_policy()/$msg->scheduling_policy($value)Type:
Enum(Google::Cloud::Batch::V1alpha::TaskGroup::SchedulingPolicy)Scheduling policy for Tasks in the TaskGroup. The default value is AS_SOON_AS_POSSIBLE.
$msg->allocation_policy()/$msg->allocation_policy($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::AllocationPolicy)Compute resource allocation for the TaskGroup. If specified, it overrides resources in Job.
$msg->labels()/$msg->labels($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::TaskGroup::LabelsEntry)Labels for the TaskGroup. Labels could be user provided or system generated. You can assign up to 64 labels. [Google Compute Engine label restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) apply. Label names that start with "goog-" or "google-" are reserved.
$msg->task_environments()/$msg->task_environments($value)Type:
Message(Google::Cloud::Batch::V1alpha::Task::Environment)An array of environment variable mappings, which are passed to Tasks with matching indices. If task_environments is used then task_count should not be specified in the request (and will be ignored). Task count will be the length of task_environments.
Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in addition to any environment variables set in task_environments, specifying the number of Tasks in the Task's parent TaskGroup, and the specific Task's index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
$msg->task_count_per_node()/$msg->task_count_per_node($value)Type:
Int64Max number of tasks that can be run on a VM at the same time. If not specified, the system will decide a value based on available compute resources on a VM and task requirements.
$msg->require_hosts_file()/$msg->require_hosts_file($value)Type:
BoolWhen true, Batch will populate a file with a list of all VMs assigned to the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path of that file. Defaults to false. The host file supports up to 1000 VMs.
$msg->permissive_ssh()/$msg->permissive_ssh($value)Type:
BoolWhen true, Batch will configure SSH to allow passwordless login between VMs running the Batch tasks in the same TaskGroup.
$msg->run_as_non_root()/$msg->run_as_non_root($value)Type:
BoolOptional. If not set or set to false, Batch uses the root user to execute runnables. If set to true, Batch runs the runnables using a non-root user. Currently, the non-root user Batch used is generated by OS Login. For more information, see [About OS Login](https://cloud.google.com/compute/docs/oslogin).
$msg->service_account()/$msg->service_account($value)Type:
Message(Google::Cloud::Batch::V1alpha::Job::ServiceAccount)Optional. ServiceAccount used by tasks within the task group for the access to other Cloud resources. This allows tasks to operate with permissions distinct from the service account for the VM set at `AllocationPolicy`. Use this field when tasks require different access rights than those of the VM.
Specify the service account's `email` field. Ensure `scopes` include any necessary permissions for tasks, in addition to the default 'cloud-platform' scope.
Enum: TaskGroup::SchedulingPolicy
SCHEDULING_POLICY_UNSPECIFIED=>0AS_SOON_AS_POSSIBLE=>1IN_ORDER=>2
Google::Cloud::Batch::V1alpha::Job::ServiceAccount
Carries information about a Google Cloud service account.
Inherits from Protobuf::Message.
Accessors
$msg->email()/$msg->email($value)Type:
StringEmail address of the service account.
$msg->scopes()/$msg->scopes($value)Type:
StringList of scopes to be enabled for this service account.
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Batch::V1alpha::Job::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.