# Google Cloud Batch V1 Client - Class Job (1.4.1)

1.4.1 (latest) 1.4.0 1.3.1 1.2.2 1.1.7 1.0.3 0.17.0 0.16.10 0.15.0 0.14.0 0.13.1 0.12.1 0.11.3 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.2 0.4.0 0.3.0 0.2.2 Reference documentation and code samples for the Google Cloud Batch V1 Client class Job.

The Cloud Batch Job description.

Generated from protobuf message `google.cloud.batch.v1.Job`

## Namespace

Google \\ Cloud \\ Batch \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. Job name. For example: "projects/123456/locations/us-central1/jobs/job01". |
| `↳ uid` | `string` Output only. A system generated unique ID for the Job. |
| `↳ priority` | `int|string` Priority 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. |
| `↳ task_groups` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.TaskGroup>` Required. TaskGroups in the Job. Only one TaskGroup is supported now. |
| `↳ allocation_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.AllocationPolicy` Compute resource allocation for all TaskGroups in the Job. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` 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). |
| `↳ status` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobStatus` Output only. Job status. It is read only for users. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. When the Job was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The last time the Job was updated. |
| `↳ logs_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.LogsPolicy` Log preservation policy for the Job. |
| `↳ notifications` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobNotification>` Notification configurations. |

### getName

Output only. Job name.

For example: "projects/123456/locations/us-central1/jobs/job01".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Output only. Job name.

For example: "projects/123456/locations/us-central1/jobs/job01".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUid

Output only. A system generated unique ID for the Job.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setUid

Output only. A system generated unique ID for the Job.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPriority

Priority 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setPriority

Priority 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTaskGroups

Required. TaskGroups in the Job. Only one TaskGroup is supported now.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.TaskGroup>` |   |

### setTaskGroups

Required. TaskGroups in the Job. Only one TaskGroup is supported now.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.TaskGroup>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAllocationPolicy

Compute resource allocation for all TaskGroups in the Job.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.AllocationPolicy|null` |   |

### hasAllocationPolicy

### clearAllocationPolicy

### setAllocationPolicy

Compute resource allocation for all TaskGroups in the Job.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.AllocationPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabels

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).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

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).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStatus

Output only. Job status. It is read only for users.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobStatus|null` |   |

### hasStatus

### clearStatus

### setStatus

Output only. Job status. It is read only for users.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobStatus` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

Output only. When the Job was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. When the Job was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

Output only. The last time the Job was updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The last time the Job was updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLogsPolicy

Log preservation policy for the Job.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.LogsPolicy|null` |   |

### hasLogsPolicy

### clearLogsPolicy

### setLogsPolicy

Log preservation policy for the Job.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.LogsPolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNotifications

Notification configurations.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobNotification>` |   |

### setNotifications

Notification configurations.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-batch/latest/V1.JobNotification>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |