test_job
Creates, updates, deletes, gets or lists a test_job resource.
Overview
| Name | test_job |
| Type | Resource |
| Id | azure.automation.test_job |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
creationTime | string (date-time) | Gets or sets the creation time of the test job. |
endTime | string (date-time) | Gets or sets the end time of the test job. |
exception | string | Gets or sets the exception of the test job. |
lastModifiedTime | string (date-time) | Gets or sets the last modified time of the test job. |
lastStatusModifiedTime | string (date-time) | Gets or sets the last status modified time of the test job. |
logActivityTrace | integer | The activity-level tracing options of the runbook. |
parameters | object | Gets or sets the parameters of the test job. |
runOn | string | Gets or sets the runOn which specifies the group name where the job is to be executed. |
startTime | string (date-time) | Gets or sets the start time of the test job. |
status | string | Gets or sets the status of the test job. |
statusDetails | string | Gets or sets the status details of the test job. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, automation_account_name, runbook_name, subscription_id | Retrieve the test job for the specified runbook. | |
create | insert | resource_group_name, automation_account_name, runbook_name, subscription_id | Create a test job of the runbook. | |
resume | exec | resource_group_name, automation_account_name, runbook_name, subscription_id | Resume the test job. | |
stop | exec | resource_group_name, automation_account_name, runbook_name, subscription_id | Stop the test job. | |
suspend | exec | resource_group_name, automation_account_name, runbook_name, subscription_id | Suspend the test job. |
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 |
|---|---|---|
automation_account_name | string | The name of the automation account. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
runbook_name | string | The runbook name. Required. |
subscription_id | string |
SELECT examples
- get
Retrieve the test job for the specified runbook.
SELECT
creationTime,
endTime,
exception,
lastModifiedTime,
lastStatusModifiedTime,
logActivityTrace,
parameters,
runOn,
startTime,
status,
statusDetails
FROM azure.automation.test_job
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND automation_account_name = '{{ automation_account_name }}' -- required
AND runbook_name = '{{ runbook_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create
- Manifest
Create a test job of the runbook.
INSERT INTO azure.automation.test_job (
parameters,
runOn,
runtimeEnvironment,
resource_group_name,
automation_account_name,
runbook_name,
subscription_id
)
SELECT
'{{ parameters }}',
'{{ runOn }}',
'{{ runtimeEnvironment }}',
'{{ resource_group_name }}',
'{{ automation_account_name }}',
'{{ runbook_name }}',
'{{ subscription_id }}'
RETURNING
creationTime,
endTime,
exception,
lastModifiedTime,
lastStatusModifiedTime,
logActivityTrace,
parameters,
runOn,
startTime,
status,
statusDetails
;
# Description fields are for documentation purposes
- name: test_job
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the test_job resource.
- name: automation_account_name
value: "{{ automation_account_name }}"
description: Required parameter for the test_job resource.
- name: runbook_name
value: "{{ runbook_name }}"
description: Required parameter for the test_job resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the test_job resource.
- name: parameters
value: "{{ parameters }}"
description: |
Gets or sets the parameters of the test job.
- name: runOn
value: "{{ runOn }}"
description: |
Gets or sets the runOn which specifies the group name where the job is to be executed.
- name: runtimeEnvironment
value: "{{ runtimeEnvironment }}"
description: |
The runtime Environment Name on which job needs to be tested.
Lifecycle Methods
- resume
- stop
- suspend
Resume the test job.
EXEC azure.automation.test_job.resume
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@runbook_name='{{ runbook_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Stop the test job.
EXEC azure.automation.test_job.stop
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@runbook_name='{{ runbook_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Suspend the test job.
EXEC azure.automation.test_job.suspend
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@runbook_name='{{ runbook_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;