Menu
Run.projects.locations.jobs.create
Creates a Job.
/v2/{parent}/jobsUse it in a workflow
- Add a step and choose the Google Cloud Run Jobs connector.
- Pick the Run.projects.locations.jobs.create action (under projects).
- Fill in the fields below, then reference the result from later steps as
{{runProjectsLocationsJobsCreate.response.data}}.
Request
Path parameters
parentstringrequiredRequired. The location and project in which this Job should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number.
Query parameters
$.xgafvstringV1 error format.
One of12
access_tokenstringOAuth access token.
altstringData format for response.
One ofjsonmediaproto
callbackstringJSONP
fieldsstringSelector specifying which fields to include in a partial response.
keystringAPI key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
oauth_tokenstringOAuth 2.0 token for the current user.
prettyPrintbooleanReturns response with indentations and line breaks.
quotaUserstringAvailable to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
upload_protocolstringUpload protocol for media (e.g. "raw", "multipart").
uploadTypestringLegacy upload protocol for media (e.g. "media", "multipart").
jobIdstringRequired. The unique identifier for the Job. The name of the job becomes {parent}/jobs/{job_id}.
validateOnlybooleanIndicates that the request should be validated and default values populated, without persisting the request or creating any resources.
Request body
Enter the body as JSON in the step's Body field.
annotationsobjectKRM-style annotations for the resource. 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.
binaryAuthorizationobjectSettings for Binary Authorization feature.
breakglassJustificationstringIf present, indicates to use Breakglass using this justification. If use_default is False, then it must be empty. For more information on breakglass, see https://cloud.google.com/binary-authorization/docs/using-breakglass
useDefaultbooleanIf True, indicates to use the default project's binary authorization policy. If False, binary authorization will be disabled.
clientstringArbitrary identifier for the API client.
clientVersionstringArbitrary version identifier for the API client.
conditionsarray<object>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.
executionReasonstringA reason for the execution condition.
One ofEXECUTION_REASON_UNDEFINEDJOB_STATUS_SERVICE_POLLING_ERRORNON_ZERO_EXIT_CODECANCELLEDCANCELLING
lastTransitionTimestring (google-datetime)Last time the condition transitioned from one status to another.
messagestringHuman readable message indicating details about the current status.
reasonstringA common (service-level) reason for this condition.
One ofCOMMON_REASON_UNDEFINEDUNKNOWNREVISION_FAILEDPROGRESS_DEADLINE_EXCEEDEDCONTAINER_MISSINGCONTAINER_PERMISSION_DENIEDCONTAINER_IMAGE_UNAUTHORIZEDCONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILEDENCRYPTION_KEY_PERMISSION_DENIEDENCRYPTION_KEY_CHECK_FAILEDSECRETS_ACCESS_CHECK_FAILEDWAITING_FOR_OPERATIONIMMEDIATE_RETRYPOSTPONED_RETRYINTERNAL
revisionReasonstringA reason for the revision condition.
One ofREVISION_REASON_UNDEFINEDPENDINGRESERVERETIREDRETIRINGRECREATINGHEALTH_CHECK_CONTAINER_ERRORCUSTOMIZED_PATH_RESPONSE_PENDINGMIN_INSTANCES_NOT_PROVISIONEDACTIVE_REVISION_LIMIT_REACHEDNO_DEPLOYMENTHEALTH_CHECK_SKIPPEDMIN_INSTANCES_WARMING
severitystringHow to interpret failures of this condition, one of Error, Warning, Info
One ofSEVERITY_UNSPECIFIEDERRORWARNINGINFO
statestringState of the condition.
One ofSTATE_UNSPECIFIEDCONDITION_PENDINGCONDITION_RECONCILINGCONDITION_FAILEDCONDITION_SUCCEEDED
typestringtype is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting Types common to all resources include: * "Ready": True when the Resource is ready.
createTimestring (google-datetime)Output only. The creation time.
creatorstringOutput only. Email address of the authenticated creator.
deleteTimestring (google-datetime)Output only. The deletion time.
etagstringOutput only. A system-generated fingerprint for this version of the resource. May be used to detect modification conflict during updates.
executionCountinteger (int32)Output only. Number of executions created for this job.
expireTimestring (google-datetime)Output only. For a deleted resource, the time after which it will be permamently deleted.
generationstring (int64)Output only. A number that monotonically increases every time the user modifies the desired state.
labelsobjectKRM-style labels for the resource. 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.
lastModifierstringOutput only. Email address of the last authenticated modifier.
latestCreatedExecutionobjectReference to an Execution. Use /Executions.GetExecution with the given name to get full execution including the latest status.
completionTimestring (google-datetime)Creation timestamp of the execution.
createTimestring (google-datetime)Creation timestamp of the execution.
namestringName of the execution.
launchStagestringThe launch stage as defined by [Google Cloud Platform Launch Stages](https://cloud.google.com/terms/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.
One ofLAUNCH_STAGE_UNSPECIFIEDUNIMPLEMENTEDPRELAUNCHEARLY_ACCESSALPHABETAGADEPRECATED
namestringThe fully qualified name of this Job. Format: projects/{project}/locations/{location}/jobs/{job}
observedGenerationstring (int64)Output only. The generation of this Job. See comments in `reconciling` for additional information on reconciliation process in Cloud Run.
reconcilingbooleanOutput 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, `observed_generation` 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 `terminal_condition.state`. If reconciliation succeeded, the following fields will match: `observed_generation` and `generation`, `latest_succeeded_execution` and `latest_created_execution`. If reconciliation failed, `observed_generation` 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 `terminal_condition` and `conditions`.
satisfiesPzsbooleanOutput only. Reserved for future use.
templateobjectExecutionTemplate describes the data an execution should have when created from a template.
annotationsobjectKRM-style annotations for the resource. 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.
labelsobjectKRM-style labels for the resource. 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.
parallelisminteger (int32)Specifies the maximum desired number of tasks the execution should run at given time. Must be <= task_count. 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.
taskCountinteger (int32)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.
templateobject8 fieldsTaskTemplate describes the data a task should have when created from a template.
terminalConditionobjectDefines a status condition for a resource.
executionReasonstringA reason for the execution condition.
One ofEXECUTION_REASON_UNDEFINEDJOB_STATUS_SERVICE_POLLING_ERRORNON_ZERO_EXIT_CODECANCELLEDCANCELLING
lastTransitionTimestring (google-datetime)Last time the condition transitioned from one status to another.
messagestringHuman readable message indicating details about the current status.
reasonstringA common (service-level) reason for this condition.
One ofCOMMON_REASON_UNDEFINEDUNKNOWNREVISION_FAILEDPROGRESS_DEADLINE_EXCEEDEDCONTAINER_MISSINGCONTAINER_PERMISSION_DENIEDCONTAINER_IMAGE_UNAUTHORIZEDCONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILEDENCRYPTION_KEY_PERMISSION_DENIEDENCRYPTION_KEY_CHECK_FAILEDSECRETS_ACCESS_CHECK_FAILEDWAITING_FOR_OPERATIONIMMEDIATE_RETRYPOSTPONED_RETRYINTERNAL
revisionReasonstringA reason for the revision condition.
One ofREVISION_REASON_UNDEFINEDPENDINGRESERVERETIREDRETIRINGRECREATINGHEALTH_CHECK_CONTAINER_ERRORCUSTOMIZED_PATH_RESPONSE_PENDINGMIN_INSTANCES_NOT_PROVISIONEDACTIVE_REVISION_LIMIT_REACHEDNO_DEPLOYMENTHEALTH_CHECK_SKIPPEDMIN_INSTANCES_WARMING
severitystringHow to interpret failures of this condition, one of Error, Warning, Info
One ofSEVERITY_UNSPECIFIEDERRORWARNINGINFO
statestringState of the condition.
One ofSTATE_UNSPECIFIEDCONDITION_PENDINGCONDITION_RECONCILINGCONDITION_FAILEDCONDITION_SUCCEEDED
typestringtype is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting Types common to all resources include: * "Ready": True when the Resource is ready.
uidstringOutput only. Server assigned unique identifier for the Execution. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.
updateTimestring (google-datetime)Output only. The last-modified time.
{
"annotations": {},
"binaryAuthorization": {
"breakglassJustification": "string",
"useDefault": false
},
"client": "string",
"clientVersion": "string",
"conditions": [
{
"executionReason": "EXECUTION_REASON_UNDEFINED",
"lastTransitionTime": "string",
"message": "string",
"reason": "COMMON_REASON_UNDEFINED",
"revisionReason": "REVISION_REASON_UNDEFINED",
"severity": "SEVERITY_UNSPECIFIED",
"state": "STATE_UNSPECIFIED",
"type": "string"
}
],
"createTime": "string",
"creator": "string",
"deleteTime": "string",
"etag": "string",
"executionCount": 0,
"expireTime": "string",
"generation": "string"
}
Response
Returns 200 with an object. Read it in later steps with {{runProjectsLocationsJobsCreate.response.data.<field>}}.
donebooleanIf the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
errorobjectThe `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
codeinteger (int32)The status code, which should be an enum value of google.rpc.Code.
detailsarray<object>A list of messages that carry the error details. There is a common set of message types for APIs to use.
messagestringA developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
metadataobjectService-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
namestringThe server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
responseobjectThe normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
{
"done": false,
"error": {
"code": 0,
"details": [
{}
],
"message": "string"
},
"metadata": {},
"name": "string",
"response": {}
}
Need more? See the Google Cloud Run Jobs guide for connection setup and behaviour shared by every action.