Skip to main content

test_jobs

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

Overview

Nametest_jobs
TypeResource
Idazure.automation.test_jobs

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.
logActivityTraceinteger (int32)The 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
getselectsubscriptionId, resourceGroupName, automationAccountName, runbookNameRetrieve the test job for the specified runbook.
createinsertsubscriptionId, resourceGroupName, automationAccountName, runbookNameCreate a test job of the runbook.
resumeexecsubscriptionId, resourceGroupName, automationAccountName, runbookNameResume the test job.
stopexecsubscriptionId, resourceGroupName, automationAccountName, runbookNameStop the test job.
suspendexecsubscriptionId, resourceGroupName, automationAccountName, runbookNameSuspend 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
automationAccountNamestringThe name of the automation account.
resourceGroupNamestringName of an Azure Resource group.
runbookNamestringThe runbook name.
subscriptionIdstringGets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

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_jobs
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND automationAccountName = '{{ automationAccountName }}' -- required
AND runbookName = '{{ runbookName }}' -- required
;

INSERT examples

Create a test job of the runbook.

INSERT INTO azure.automation.test_jobs (
data__parameters,
data__runOn,
subscriptionId,
resourceGroupName,
automationAccountName,
runbookName
)
SELECT
'{{ parameters }}',
'{{ runOn }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ automationAccountName }}',
'{{ runbookName }}'
RETURNING
creationTime,
endTime,
exception,
lastModifiedTime,
lastStatusModifiedTime,
logActivityTrace,
parameters,
runOn,
startTime,
status,
statusDetails
;

Lifecycle Methods

Resume the test job.

EXEC azure.automation.test_jobs.resume 
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@automationAccountName='{{ automationAccountName }}' --required,
@runbookName='{{ runbookName }}' --required
;