Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idazure.data_box.jobs

Fields

The following fields are returned by SELECT queries:

Job object.

NameDatatypeDescription
idstringId of the object.
namestringName of the object.
identityobjectMsi identity of the resource
locationstringThe location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed.
propertiesobjectProperties of a job.
skuobjectThe sku type.
systemDataobjectMetadata pertaining to creation and last modification of the resource.
tagsobjectThe list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).
typestringType of the object.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, jobName$expandGets information about the specified job.
list_by_resource_groupselectsubscriptionId, resourceGroupName$skipTokenLists all the jobs available under the given resource group.
listselectsubscriptionId$skipTokenLists all the jobs available under the subscription.
createinsertsubscriptionId, resourceGroupName, jobName, data__propertiesCreates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API.
updateupdatesubscriptionId, resourceGroupName, jobNameIf-MatchUpdates the properties of an existing job.
deletedeletesubscriptionId, resourceGroupName, jobNameDeletes a job.
mark_devices_shippedexecjobName, subscriptionId, resourceGroupName, deliverToDcPackageDetailsRequest to mark devices for a given job as shipped
book_shipment_pick_upexecsubscriptionId, resourceGroupName, jobName, startTime, endTime, shipmentLocationBook shipment pick up.
cancelexecsubscriptionId, resourceGroupName, jobName, reasonCancelJob.

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
jobNamestringThe name of the job Resource within the specified resource group. job names must be between 3 and 24 characters in length and use any alphanumeric and underscore only
resourceGroupNamestringThe Resource Group Name
subscriptionIdstringThe Subscription Id
$expandstring$expand is supported on details parameter for job, which provides details on the job stages.
$skipTokenstring$skipToken is supported on Get list of jobs, which provides the next page in the list of jobs.
If-MatchstringDefines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value.

SELECT examples

Gets information about the specified job.

SELECT
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type
FROM azure.data_box.jobs
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND jobName = '{{ jobName }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update job API.

INSERT INTO azure.data_box.jobs (
data__location,
data__tags,
data__sku,
data__identity,
data__properties,
subscriptionId,
resourceGroupName,
jobName
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ sku }}',
'{{ identity }}',
'{{ properties }}' /* required */,
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ jobName }}'
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type
;

UPDATE examples

Updates the properties of an existing job.

UPDATE azure.data_box.jobs
SET
data__properties = '{{ properties }}',
data__tags = '{{ tags }}',
data__identity = '{{ identity }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND jobName = '{{ jobName }}' --required
AND If-Match = '{{ If-Match}}'
RETURNING
id,
name,
identity,
location,
properties,
sku,
systemData,
tags,
type;

DELETE examples

Deletes a job.

DELETE FROM azure.data_box.jobs
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND jobName = '{{ jobName }}' --required
;

Lifecycle Methods

Request to mark devices for a given job as shipped

EXEC azure.data_box.jobs.mark_devices_shipped 
@jobName='{{ jobName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required
@@json=
'{
"deliverToDcPackageDetails": "{{ deliverToDcPackageDetails }}"
}'
;