Skip to main content

test_job

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

Overview

Nametest_job
TypeResource
Idazure.automation.test_job

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creationTimestring (date-time)Gets or sets the creation time of the test job.
endTimestring (date-time)Gets or sets the end time of the test job.
exceptionstringGets or sets the exception of the test job.
lastModifiedTimestring (date-time)Gets or sets the last modified time of the test job.
lastStatusModifiedTimestring (date-time)Gets or sets the last status modified time of the test job.
logActivityTraceintegerThe activity-level tracing options of the runbook.
parametersobjectGets or sets the parameters of the test job.
runOnstringGets or sets the runOn which specifies the group name where the job is to be executed.
startTimestring (date-time)Gets or sets the start time of the test job.
statusstringGets or sets the status of the test job.
statusDetailsstringGets or sets the status details of the test job.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, automation_account_name, runbook_name, subscription_idRetrieve the test job for the specified runbook.
createinsertresource_group_name, automation_account_name, runbook_name, subscription_idCreate a test job of the runbook.
resumeexecresource_group_name, automation_account_name, runbook_name, subscription_idResume the test job.
stopexecresource_group_name, automation_account_name, runbook_name, subscription_idStop the test job.
suspendexecresource_group_name, automation_account_name, runbook_name, subscription_idSuspend 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.

NameDatatypeDescription
automation_account_namestringThe name of the automation account. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
runbook_namestringThe runbook name. Required.
subscription_idstring

SELECT examples

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 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
;

Lifecycle Methods

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
;