Skip to main content

job_invocations

Creates, updates, deletes, gets or lists a job_invocations resource.

Overview

Namejob_invocations
TypeResource
Iddigitalocean.apps.job_invocations

Fields

The following fields are returned by SELECT queries:

A JSON with key job_invocation

NameDatatypeDescription
idstring (title: The ID of the job invocation, example: ba32b134-569c-4c0c-ba02-8ffdb0492ece)
deployment_idstring (title: The deployment ID this job invocation belongs to., example: c020763f-ddb7-4112-a0df-7f01c69fc00b)
job_namestring (title: The name of the job this invocation belongs to., example: good-job)
completed_atstring (date-time) (title: The time when the job invocation completed, example: 2023-10-01T12:10:00Z)
created_atstring (date-time) (title: The time when the job invocation was created, example: 2023-10-01T12:00:00Z)
phasestringThe phase of the job invocation (UNKNOWN, PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, SKIPPED) (example: SUCCEEDED)
started_atstring (date-time) (title: The time when the job invocation started, example: 2023-10-01T12:05:00Z)
triggerobject (title: The JobInvocation Trigger)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
apps_get_job_invocationselectapp_id, job_invocation_idjob_nameGet a specific job invocation for an app.
apps_list_job_invocationsselectapp_idjob_names, deployment_id, page, per_pageList all job invocations for an app.
apps_cancel_job_invocationexecapp_id, job_invocation_idjob_nameCancel a specific job invocation for an app.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
app_idstringThe app ID (example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf)
job_invocation_idstringThe ID of the job invocation to retrieve. (example: 123e4567-e89b-12d3-a456-426)
deployment_idstringThe deployment ID (example: 3aa4d20e-5527-4c00-b496-601fbd22520a)
job_namestringThe job name to list job invocations for. (example: component)
job_namesarrayThe job names to list job invocations for. (example: [component1, component2])
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

Get a specific job invocation for an app.

SELECT
id,
deployment_id,
job_name,
completed_at,
created_at,
phase,
started_at,
trigger
FROM digitalocean.apps.job_invocations
WHERE app_id = '{{ app_id }}' -- required
AND job_invocation_id = '{{ job_invocation_id }}' -- required
AND job_name = '{{ job_name }}'
;

Lifecycle Methods

Cancel a specific job invocation for an app.

EXEC digitalocean.apps.job_invocations.apps_cancel_job_invocation
@app_id='{{ app_id }}' --required,
@job_invocation_id='{{ job_invocation_id }}' --required,
@job_name='{{ job_name }}'
;