tasks
Creates, updates, deletes, gets or lists a tasks resource.
Overview
| Name | tasks |
| Type | Resource |
| Id | azure.data_migration.tasks |
Fields
The following fields are returned by SELECT queries:
- get
- list
| 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. |
clientData | object | Key value pairs of client data to attach meta data information to task. |
commands | array | Array of command properties. |
errors | array | Array of errors. This is ignored if submitted. |
etag | string | HTTP strong entity tag value. This is ignored if submitted. |
state | string | The state of the task. This is ignored if submitted. Known values are: "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted". (Unknown, Queued, Running, Canceled, Succeeded, Failed, FailedInputValidation, Faulted) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
taskType | string | Task type. Required. Known values are: "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", "ConnectToTarget.AzureDbForPostgreSql.Sync", "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", and "MigrateSchemaSqlServerSqlDb". |
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. |
clientData | object | Key value pairs of client data to attach meta data information to task. |
commands | array | Array of command properties. |
errors | array | Array of errors. This is ignored if submitted. |
etag | string | HTTP strong entity tag value. This is ignored if submitted. |
state | string | The state of the task. This is ignored if submitted. Known values are: "Unknown", "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted". (Unknown, Queued, Running, Canceled, Succeeded, Failed, FailedInputValidation, Faulted) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
taskType | string | Task type. Required. Known values are: "Connect.MongoDb", "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync", "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync", "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync", "ConnectToTarget.AzureDbForPostgreSql.Sync", "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI", "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql", "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle", "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb", "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync", "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql", "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync", "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI", "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb", "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis", "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", and "MigrateSchemaSqlServerSqlDb". |
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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | group_name, service_name, project_name, task_name, subscription_id | $expand | Get task information. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The GET method retrieves information about a task. |
list | select | group_name, service_name, project_name, subscription_id | taskType | Get tasks in a service. The services resource is the top-level resource that represents the Azure Database Migration Service (classic). This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task. |
create_or_update | insert | group_name, service_name, project_name, task_name, subscription_id | Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one. | |
update | update | group_name, service_name, project_name, task_name, subscription_id | Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so. | |
create_or_update | replace | group_name, service_name, project_name, task_name, subscription_id | Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one. | |
delete | delete | group_name, service_name, project_name, task_name, subscription_id | deleteRunningTasks | Delete task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The DELETE method deletes a task, canceling it first if it's running. |
cancel | exec | group_name, service_name, project_name, task_name, subscription_id | Cancel a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This method cancels a task if it's currently queued or running. | |
command | exec | group_name, service_name, project_name, task_name, subscription_id, commandType | Execute a command on a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This method executes a command on a running task. |
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 |
|---|---|---|
group_name | string | Name of the resource group. Required. |
project_name | string | Name of the project. Required. |
service_name | string | Name of the service. Required. |
subscription_id | string | |
task_name | string | Name of the Task. Required. |
$expand | string | Expand the response. Default value is None. |
deleteRunningTasks | boolean | Delete the resource even if it contains running tasks. Default value is None. |
taskType | string | Filter tasks by task type. Default value is None. |
SELECT examples
- get
- list
Get task information. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The GET method retrieves information about a task.
SELECT
id,
name,
clientData,
commands,
errors,
etag,
state,
systemData,
taskType,
type
FROM azure.data_migration.tasks
WHERE group_name = '{{ group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND project_name = '{{ project_name }}' -- required
AND task_name = '{{ task_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
Get tasks in a service. The services resource is the top-level resource that represents the Azure Database Migration Service (classic). This method returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates that an error occurred while querying the status of that task.
SELECT
id,
name,
clientData,
commands,
errors,
etag,
state,
systemData,
taskType,
type
FROM azure.data_migration.tasks
WHERE group_name = '{{ group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND project_name = '{{ project_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND taskType = '{{ taskType }}'
;
INSERT examples
- create_or_update
- Manifest
Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one.
INSERT INTO azure.data_migration.tasks (
properties,
etag,
group_name,
service_name,
project_name,
task_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ etag }}',
'{{ group_name }}',
'{{ service_name }}',
'{{ project_name }}',
'{{ task_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: tasks
props:
- name: group_name
value: "{{ group_name }}"
description: Required parameter for the tasks resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the tasks resource.
- name: project_name
value: "{{ project_name }}"
description: Required parameter for the tasks resource.
- name: task_name
value: "{{ task_name }}"
description: Required parameter for the tasks resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the tasks resource.
- name: properties
description: |
Custom task properties.
value:
taskType: "{{ taskType }}"
errors:
- code: "{{ code }}"
message: "{{ message }}"
details: "{{ details }}"
state: "{{ state }}"
commands:
- commandType: "{{ commandType }}"
errors: "{{ errors }}"
state: "{{ state }}"
clientData: "{{ clientData }}"
- name: etag
value: "{{ etag }}"
description: |
HTTP strong entity tag value. This is ignored if submitted.
UPDATE examples
- update
Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PATCH method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do so.
UPDATE azure.data_migration.tasks
SET
properties = '{{ properties }}',
etag = '{{ etag }}'
WHERE
group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND task_name = '{{ task_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
type;
REPLACE examples
- create_or_update
Create or update task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The PUT method creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is little reason to update an existing one.
REPLACE azure.data_migration.tasks
SET
properties = '{{ properties }}',
etag = '{{ etag }}'
WHERE
group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND task_name = '{{ task_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
type;
DELETE examples
- delete
Delete task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. The DELETE method deletes a task, canceling it first if it's running.
DELETE FROM azure.data_migration.tasks
WHERE group_name = '{{ group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND project_name = '{{ project_name }}' --required
AND task_name = '{{ task_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND deleteRunningTasks = '{{ deleteRunningTasks }}'
;
Lifecycle Methods
- cancel
- command
Cancel a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This method cancels a task if it's currently queued or running.
EXEC azure.data_migration.tasks.cancel
@group_name='{{ group_name }}' --required,
@service_name='{{ service_name }}' --required,
@project_name='{{ project_name }}' --required,
@task_name='{{ task_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Execute a command on a task. The tasks resource is a nested, proxy-only resource representing work performed by a DMS (classic) instance. This method executes a command on a running task.
EXEC azure.data_migration.tasks.command
@group_name='{{ group_name }}' --required,
@service_name='{{ service_name }}' --required,
@project_name='{{ project_name }}' --required,
@task_name='{{ task_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"commandType": "{{ commandType }}"
}'
;