REST Resource: projects.locations.jobs

Resource: Job

Job represents the configuration of a single job, which references a container image that is run to completion.

JSON representation
{
  "name": string,
  "uid": string,
  "generation": string,
  "labels": {
    string: string,
    ...
  },
  "annotations": {
    string: string,
    ...
  },
  "createTime": string,
  "updateTime": string,
  "deleteTime": string,
  "expireTime": string,
  "creator": string,
  "lastModifier": string,
  "client": string,
  "clientVersion": string,
  "launchStage": enum (LaunchStage),
  "binaryAuthorization": {
    object (BinaryAuthorization)
  },
  "template": {
    object (ExecutionTemplate)
  },
  "observedGeneration": string,
  "terminalCondition": {
    object (Condition)
  },
  "conditions": [
    {
      object (Condition)
    }
  ],
  "executionCount": integer,
  "latestCreatedExecution": {
    object (ExecutionReference)
  },
  "reconciling": boolean,
  "satisfiesPzs": boolean,
  "etag": string,

  // Union field create_execution can be only one of the following:
  "startExecutionToken": string,
  "runExecutionToken": string
  // End of list of possible types for union field create_execution.
}
Fields
name

string

The fully qualified name of this Job.

Format: projects/{project}/locations/{location}/jobs/{job}

uid

string

Output only. Server assigned unique identifier for the Execution. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

generation

string (int64 format)

Output only. A number that monotonically increases every time the user modifies the desired state.

labels

map (key: string, value: string)

Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 Job.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

annotations

map (key: string, value: string)

Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected on new resources. All system annotations in v1 now have a corresponding field in v2 Job.

This field follows Kubernetes annotations' namespacing, limits, and rules.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

createTime

string (Timestamp format)

Output only. The creation time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The last-modified time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

deleteTime

string (Timestamp format)

Output only. The deletion time. It is only populated as a response to a Delete request.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

expireTime

string (Timestamp format)

Output only. For a deleted resource, the time after which it will be permamently deleted.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

creator

string

Output only. Email address of the authenticated creator.

lastModifier

string

Output only. Email address of the last authenticated modifier.

client

string

Arbitrary identifier for the API client.

clientVersion

string

Arbitrary version identifier for the API client.

launchStage

enum (LaunchStage)

The launch stage as defined by Google Cloud Platform Launch Stages. Cloud Run supports ALPHA, BETA, and GA. If no value is specified, GA is assumed. Set the launch stage to a preview stage on input to allow use of preview features in that stage. On read (or output), describes whether the resource uses preview features.

For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output.

binaryAuthorization

object (BinaryAuthorization)

Settings for the Binary Authorization feature.

template

object (ExecutionTemplate)

Required. The template used to create executions for this Job.

observedGeneration

string (int64 format)

Output only. The generation of this Job. See comments in reconciling for additional information on reconciliation process in Cloud Run.

terminalCondition

object (Condition)

Output only. The Condition of this Job, containing its readiness status, and detailed error information in case it did not reach the desired state.

conditions[]

object (Condition)

Output only. The Conditions of all other associated sub-resources. They contain additional diagnostics information in case the Job does not reach its desired state. See comments in reconciling for additional information on reconciliation process in Cloud Run.

executionCount

integer

Output only. Number of executions created for this job.

latestCreatedExecution

object (ExecutionReference)

Output only. Name of the last created execution.

reconciling

boolean

Output only. Returns true if the Job is currently being acted upon by the system to bring it into the desired state.

When a new Job is created, or an existing one is updated, Cloud Run will asynchronously perform all necessary steps to bring the Job to the desired state. This process is called reconciliation. While reconciliation is in process, observedGeneration and latest_succeeded_execution, will have transient values that might mismatch the intended state: Once reconciliation is over (and this field is false), there are two possible outcomes: reconciliation succeeded and the state matches the Job, or there was an error, and reconciliation failed. This state can be found in terminalCondition.state.

If reconciliation succeeded, the following fields will match: observedGeneration and generation, latest_succeeded_execution and latestCreatedExecution.

If reconciliation failed, observedGeneration and latest_succeeded_execution will have the state of the last succeeded execution or empty for newly created Job. Additional information on the failure can be found in terminalCondition and conditions.

satisfiesPzs

boolean

Output only. Reserved for future use.

etag

string

Output only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.

Union field create_execution.

create_execution can be only one of the following:

startExecutionToken

string

A unique string used as a suffix creating a new execution. The Job will become ready when the execution is successfully started. The sum of job name and token length must be fewer than 63 characters.

runExecutionToken

string

A unique string used as a suffix for creating a new execution. The Job will become ready when the execution is successfully completed. The sum of job name and token length must be fewer than 63 characters.

ExecutionTemplate

ExecutionTemplate describes the data an execution should have when created from a template.

JSON representation
{
  "labels": {
    string: string,
    ...
  },
  "annotations": {
    string: string,
    ...
  },
  "parallelism": integer,
  "taskCount": integer,
  "template": {
    object (TaskTemplate)
  }
}
Fields
labels

map (key: string, value: string)

Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system labels in v1 now have a corresponding field in v2 ExecutionTemplate.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

annotations

map (key: string, value: string)

Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with run.googleapis.com, cloud.googleapis.com, serving.knative.dev, or autoscaling.knative.dev namespaces, and they will be rejected. All system annotations in v1 now have a corresponding field in v2 ExecutionTemplate.

This field follows Kubernetes annotations' namespacing, limits, and rules.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

parallelism

integer

Specifies the maximum desired number of tasks the execution should run at given time. Must be <= taskCount. When the job is run, if this field is 0 or unset, the maximum possible value will be used for that execution. The actual number of tasks running in steady state will be less than this number when there are fewer tasks waiting to be completed remaining, i.e. when the work left to do is less than max parallelism.

taskCount

integer

Specifies the desired number of tasks the execution should run. Setting to 1 means that parallelism is limited to 1 and the success of that task signals the success of the execution. Defaults to 1.

template

object (TaskTemplate)

Required. Describes the task(s) that will be created when executing an execution.

ExecutionReference

Reference to an Execution. Use /Executions.GetExecution with the given name to get full execution including the latest status.

JSON representation
{
  "name": string,
  "createTime": string,
  "completionTime": string,
  "deleteTime": string,
  "completionStatus": enum (CompletionStatus)
}
Fields
name

string

Name of the execution.

createTime

string (Timestamp format)

Creation timestamp of the execution.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

completionTime

string (Timestamp format)

Creation timestamp of the execution.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

deleteTime

string (Timestamp format)

The deletion time of the execution. It is only populated as a response to a Delete request.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

completionStatus

enum (CompletionStatus)

Status for the execution completion.

CompletionStatus

Possible execution completion status.

Enums
COMPLETION_STATUS_UNSPECIFIED The default value. This value is used if the state is omitted.
EXECUTION_SUCCEEDED Job execution has succeeded.
EXECUTION_FAILED Job execution has failed.
EXECUTION_RUNNING Job execution is running normally.
EXECUTION_PENDING Waiting for backing resources to be provisioned.
EXECUTION_CANCELLED Job execution has been cancelled by the user.

Methods

create

Creates a Job.

delete

Deletes a Job.

get

Gets information about a Job.

getIamPolicy

Gets the IAM Access Control policy currently in effect for the given Job.

list

Lists Jobs.

patch

Updates a Job.

run

Triggers creation of a new Execution of this Job.

setIamPolicy

Sets the IAM Access control policy for the specified Job.

testIamPermissions

Returns permissions that a caller has on the specified Project.