job_executions
Creates, updates, deletes, gets or lists a job_executions resource.
Overview
| Name | job_executions |
| Type | Resource |
| Id | azure.sql.job_executions |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_job
- list_by_agent
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
createTime | string (date-time) | The time that the job execution was created. |
currentAttemptStartTime | string (date-time) | Start time of the current attempt. |
currentAttempts | integer | Number of times the job execution has been attempted. |
endTime | string (date-time) | The time that the job execution completed. |
jobExecutionId | string | The unique identifier of the job execution. |
jobVersion | integer | The job version number. |
lastMessage | string | The last status or error message. |
lifecycle | string | The detailed state of the job execution. Known values are: "Created", "InProgress", "WaitingForChildJobExecutions", "WaitingForRetry", "Succeeded", "SucceededWithSkipped", "Failed", "TimedOut", "Canceled", and "Skipped". (Created, InProgress, WaitingForChildJobExecutions, WaitingForRetry, Succeeded, SucceededWithSkipped, Failed, TimedOut, Canceled, Skipped) |
provisioningState | string | The ARM provisioning state of the job execution. Known values are: "Created", "InProgress", "Succeeded", "Failed", and "Canceled". (Created, InProgress, Succeeded, Failed, Canceled) |
startTime | string (date-time) | The time that the job execution started. |
stepId | integer | The job step id. |
stepName | string | The job step name. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
target | object | The target that this execution is executed on. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
createTime | string (date-time) | The time that the job execution was created. |
currentAttemptStartTime | string (date-time) | Start time of the current attempt. |
currentAttempts | integer | Number of times the job execution has been attempted. |
endTime | string (date-time) | The time that the job execution completed. |
jobExecutionId | string | The unique identifier of the job execution. |
jobVersion | integer | The job version number. |
lastMessage | string | The last status or error message. |
lifecycle | string | The detailed state of the job execution. Known values are: "Created", "InProgress", "WaitingForChildJobExecutions", "WaitingForRetry", "Succeeded", "SucceededWithSkipped", "Failed", "TimedOut", "Canceled", and "Skipped". (Created, InProgress, WaitingForChildJobExecutions, WaitingForRetry, Succeeded, SucceededWithSkipped, Failed, TimedOut, Canceled, Skipped) |
provisioningState | string | The ARM provisioning state of the job execution. Known values are: "Created", "InProgress", "Succeeded", "Failed", and "Canceled". (Created, InProgress, Succeeded, Failed, Canceled) |
startTime | string (date-time) | The time that the job execution started. |
stepId | integer | The job step id. |
stepName | string | The job step name. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
target | object | The target that this execution is executed on. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
createTime | string (date-time) | The time that the job execution was created. |
currentAttemptStartTime | string (date-time) | Start time of the current attempt. |
currentAttempts | integer | Number of times the job execution has been attempted. |
endTime | string (date-time) | The time that the job execution completed. |
jobExecutionId | string | The unique identifier of the job execution. |
jobVersion | integer | The job version number. |
lastMessage | string | The last status or error message. |
lifecycle | string | The detailed state of the job execution. Known values are: "Created", "InProgress", "WaitingForChildJobExecutions", "WaitingForRetry", "Succeeded", "SucceededWithSkipped", "Failed", "TimedOut", "Canceled", and "Skipped". (Created, InProgress, WaitingForChildJobExecutions, WaitingForRetry, Succeeded, SucceededWithSkipped, Failed, TimedOut, Canceled, Skipped) |
provisioningState | string | The ARM provisioning state of the job execution. Known values are: "Created", "InProgress", "Succeeded", "Failed", and "Canceled". (Created, InProgress, Succeeded, Failed, Canceled) |
startTime | string (date-time) | The time that the job execution started. |
stepId | integer | The job step id. |
stepName | string | The job step name. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
target | object | The target that this execution is executed on. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
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 |
|---|---|---|
job_agent_name | string | The name of the job agent. Required. |
job_execution_id | string | The id of the job execution. Required. |
job_name | string | The name of the job. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
server_name | string | The name of the server. Required. |
subscription_id | string | |
$skip | integer | The number of elements in the collection to skip. Default value is None. |
$top | integer | The number of elements to return from the collection. Default value is None. |
createTimeMax | string (date-time) | If specified, only job executions created before the specified time are included. Default value is None. |
createTimeMin | string (date-time) | If specified, only job executions created at or after the specified time are included. Default value is None. |
endTimeMax | string (date-time) | If specified, only job executions completed before the specified time are included. Default value is None. |
endTimeMin | string (date-time) | If specified, only job executions completed at or after the specified time are included. Default value is None. |
isActive | boolean | If specified, only active or only completed job executions are included. Default value is None. |
SELECT examples
- get
- list_by_job
- list_by_agent
Gets a job execution.
SELECT
id,
name,
createTime,
currentAttemptStartTime,
currentAttempts,
endTime,
jobExecutionId,
jobVersion,
lastMessage,
lifecycle,
provisioningState,
startTime,
stepId,
stepName,
systemData,
target,
type
FROM azure.sql.job_executions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND job_agent_name = '{{ job_agent_name }}' -- required
AND job_name = '{{ job_name }}' -- required
AND job_execution_id = '{{ job_execution_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists a job's executions.
SELECT
id,
name,
createTime,
currentAttemptStartTime,
currentAttempts,
endTime,
jobExecutionId,
jobVersion,
lastMessage,
lifecycle,
provisioningState,
startTime,
stepId,
stepName,
systemData,
target,
type
FROM azure.sql.job_executions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND job_agent_name = '{{ job_agent_name }}' -- required
AND job_name = '{{ job_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND createTimeMin = '{{ createTimeMin }}'
AND createTimeMax = '{{ createTimeMax }}'
AND endTimeMin = '{{ endTimeMin }}'
AND endTimeMax = '{{ endTimeMax }}'
AND isActive = '{{ isActive }}'
AND $skip = '{{ $skip }}'
AND $top = '{{ $top }}'
;
Lists all executions in a job agent.
SELECT
id,
name,
createTime,
currentAttemptStartTime,
currentAttempts,
endTime,
jobExecutionId,
jobVersion,
lastMessage,
lifecycle,
provisioningState,
startTime,
stepId,
stepName,
systemData,
target,
type
FROM azure.sql.job_executions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND job_agent_name = '{{ job_agent_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND createTimeMin = '{{ createTimeMin }}'
AND createTimeMax = '{{ createTimeMax }}'
AND endTimeMin = '{{ endTimeMin }}'
AND endTimeMax = '{{ endTimeMax }}'
AND isActive = '{{ isActive }}'
AND $skip = '{{ $skip }}'
AND $top = '{{ $top }}'
;
INSERT examples
- create_or_update
- create
- Manifest
Creates or updates a job execution.
INSERT INTO azure.sql.job_executions (
resource_group_name,
server_name,
job_agent_name,
job_name,
job_execution_id,
subscription_id
)
SELECT
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ job_agent_name }}',
'{{ job_name }}',
'{{ job_execution_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
Starts an elastic job execution.
INSERT INTO azure.sql.job_executions (
resource_group_name,
server_name,
job_agent_name,
job_name,
subscription_id
)
SELECT
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ job_agent_name }}',
'{{ job_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: job_executions
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the job_executions resource.
- name: server_name
value: "{{ server_name }}"
description: Required parameter for the job_executions resource.
- name: job_agent_name
value: "{{ job_agent_name }}"
description: Required parameter for the job_executions resource.
- name: job_name
value: "{{ job_name }}"
description: Required parameter for the job_executions resource.
- name: job_execution_id
value: "{{ job_execution_id }}"
description: Required parameter for the job_executions resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the job_executions resource.
REPLACE examples
- create_or_update
Creates or updates a job execution.
REPLACE azure.sql.job_executions
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND job_agent_name = '{{ job_agent_name }}' --required
AND job_name = '{{ job_name }}' --required
AND job_execution_id = '{{ job_execution_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
Lifecycle Methods
- cancel
Requests cancellation of a job execution.
EXEC azure.sql.job_executions.cancel
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@job_agent_name='{{ job_agent_name }}' --required,
@job_name='{{ job_name }}' --required,
@job_execution_id='{{ job_execution_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;