job_invocations
Creates, updates, deletes, gets or lists a job_invocations resource.
Overview
| Name | job_invocations |
| Type | Resource |
| Id | digitalocean.apps.job_invocations |
Fields
The following fields are returned by SELECT queries:
- apps_get_job_invocation
- apps_list_job_invocations
A JSON with key job_invocation
| Name | Datatype | Description |
|---|---|---|
id | string | (title: The ID of the job invocation, example: ba32b134-569c-4c0c-ba02-8ffdb0492ece) |
deployment_id | string | (title: The deployment ID this job invocation belongs to., example: c020763f-ddb7-4112-a0df-7f01c69fc00b) |
job_name | string | (title: The name of the job this invocation belongs to., example: good-job) |
completed_at | string (date-time) | (title: The time when the job invocation completed, example: 2023-10-01T12:10:00Z) |
created_at | string (date-time) | (title: The time when the job invocation was created, example: 2023-10-01T12:00:00Z) |
phase | string | The phase of the job invocation (UNKNOWN, PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, SKIPPED) (example: SUCCEEDED) |
started_at | string (date-time) | (title: The time when the job invocation started, example: 2023-10-01T12:05:00Z) |
trigger | object | (title: The JobInvocation Trigger) |
A JSON with key job_invocations
| Name | Datatype | Description |
|---|---|---|
id | string | (title: The ID of the job invocation, example: ba32b134-569c-4c0c-ba02-8ffdb0492ece) |
deployment_id | string | (title: The deployment ID this job invocation belongs to., example: c020763f-ddb7-4112-a0df-7f01c69fc00b) |
job_name | string | (title: The name of the job this invocation belongs to., example: good-job) |
completed_at | string (date-time) | (title: The time when the job invocation completed, example: 2023-10-01T12:10:00Z) |
created_at | string (date-time) | (title: The time when the job invocation was created, example: 2023-10-01T12:00:00Z) |
phase | string | The phase of the job invocation (UNKNOWN, PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, SKIPPED) (example: SUCCEEDED) |
started_at | string (date-time) | (title: The time when the job invocation started, example: 2023-10-01T12:05:00Z) |
trigger | object | (title: The JobInvocation Trigger) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
apps_get_job_invocation | select | app_id, job_invocation_id | job_name | Get a specific job invocation for an app. |
apps_list_job_invocations | select | app_id | job_names, deployment_id, page, per_page | List all job invocations for an app. |
apps_cancel_job_invocation | exec | app_id, job_invocation_id | job_name | Cancel 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.
| Name | Datatype | Description |
|---|---|---|
app_id | string | The app ID (example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf) |
job_invocation_id | string | The ID of the job invocation to retrieve. (example: 123e4567-e89b-12d3-a456-426) |
deployment_id | string | The deployment ID (example: 3aa4d20e-5527-4c00-b496-601fbd22520a) |
job_name | string | The job name to list job invocations for. (example: component) |
job_names | array | The job names to list job invocations for. (example: [component1, component2]) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT examples
- apps_get_job_invocation
- apps_list_job_invocations
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 }}'
;
List all job invocations 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_names = '{{ job_names }}'
AND deployment_id = '{{ deployment_id }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
;
Lifecycle Methods
- apps_cancel_job_invocation
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 }}'
;