Manage Alibaba Cloud DTS (Data Transmission Service) tasks: create data migration/synchronization tasks, view task status/latency, stop/start/release tasks. All operations are guided interactively.
Determine the operation mode based on user input, and read the corresponding references file for detailed workflow:
User IntentKeywordsActionReference FileCreate migration taskempty / "create" / "new" / "migration"Interactive creationreferences/create-task.mdCreate sync task"sync" / "synchronization"Interactive sync task creationreferences/create-task.mdView task list"list" / "view" / "ls"List all tasksreferences/list-tasks.mdView task status"status ID"View specified task detailsreferences/task-status.mdStop task"stop ID" / "suspend ID" / "pause ID"Suspend specified taskreferences/suspend-task.mdStart/Resume task"start ID" / "resume ID"Start or resume taskreferences/start-task.mdRelease task"release ID" / "delete ID" / "remove ID"Release (delete) taskreferences/delete-task.mdEnvironment setup"setup" / "configure" / "init"Check and configure environmentreferences/setup.md
When no parameters are provided, ask the user to choose the desired operation.
Steps (full details in references/create-task.md):
******) and confirmExample input: "Create a MySQL to Kafka sync task" Example output:
text
DTS task created successfully!
Instance ID: <dts-instance-id>
Job ID: <job-id>
Status: Initializing
To check status: aliyun dts DescribeDtsJobDetail --DtsJobId <job-id> --RegionId cn-hangzhou
Steps (full details in references/list-tasks.md):
Example input: "List my DTS tasks" Example output:
text
| Task ID | Name | Type | Status | Source | Destination | Delay |
|----------------|------------------------------|-----------|----------------|--------------|--------------|--------|
| <job-id-1> | migration-mysql-mysql-0401 | MIGRATION | Migrating | RDS MySQL | RDS MySQL | - |
| <job-id-2> | sync-mysql-kafka-0401 | SYNC | Synchronizing | RDS MySQL | Kafka | 128ms |
Steps (full details in references/task-status.md):
Example input: "Check status of " Example output:
text
Task: <job-id> (migration-mysql-mysql-0401)
Type: MIGRATION
Status: Migrating
Progress:
Schema migration: Finished
Full data migration: Finished (1,234,567 rows)
Incremental: Running, delay 236ms
Source: RDS MySQL <source-instance-id> (cn-hangzhou)
Destination: RDS MySQL <dest-instance-id> (cn-hangzhou)
Stop (full details in references/suspend-task.md):
Start/Resume (full details in references/start-task.md):
Release/Delete (full details in references/delete-task.md):
Steps (full details in references/setup.md):
DescribeDtsJobDetail uses --DtsInstanceID (uppercase D), while DeleteDtsJob/ ConfigureDtsJob use --DtsInstanceId (lowercase d). Always verify with aliyun dts <API> help before calling.--read-timeout 30 --connect-timeout 10. CreateDtsInstance includes --ClientToken (UUID) for idempotent retries.--JobType parameter defaults to MIGRATION; omitting it silently drops sync/subscribe tasks. Never use --Type (causes InvalidParameter).--SourceEndpointDatabaseName in ConfigureDtsJob.Important: All information gathering must use interactive selections to avoid workflow interruption from free-text questions.
Applicable to scenarios with fixed choices: task type, engine type, access method, instance selection, migration type, specification selection, etc.
Applicable to scenarios requiring user free input: IP address, port, username, password, database name, table name, etc. Provide common default values as options; users can select or enter custom values. Consolidate related input items into as few interaction rounds as possible.
CRITICAL: Passwords, AccessKey Secrets, certificates, and private keys must NEVER appear in plaintext anywhere in the conversation — this applies to ALL stages:
****** for password fields.'******', never the actual value. The real value is only used internally when executing the command.Use single quotes around passwords in actual CLI execution to prevent shell expansion.
Before executing any operation, the following checks must be performed:
bash
which aliyun
If not installed, prompt the user:
brew install aliyun-clialiyun configure to set up authenticationbash
aliyun configure list
If not configured, guide the user through setup:
bash
aliyun configure --mode AK
Requires: AccessKey ID, AccessKey Secret, Region Id
Important: Never display the user's AccessKey Secret in the conversation. Protect sensitive information.
Let the user select a Region using interactive choices, not text input.
Supported Region list:
Mainland China:
Region IDNamecn-beijingChina North 2 (Beijing)cn-hangzhouChina East 1 (Hangzhou)cn-shanghaiChina East 2 (Shanghai)cn-shenzhenChina South 1 (Shenzhen)cn-guangzhouChina South 3 (Guangzhou)cn-qingdaoChina North 1 (Qingdao)cn-zhangjiakouChina North 3 (Zhangjiakou)cn-huhehaoteChina North 5 (Hohhot)cn-wulanchabuChina North 6 (Ulanqab)cn-heyuanChina South 2 (Heyuan)cn-chengduChina Southwest 1 (Chengdu)cn-nanjingChina East 5 (Nanjing - Local Region)cn-fuzhouChina East 6 (Fuzhou - Local Region)cn-wuhan-lrChina Central 1 (Wuhan - Local Region)
Hong Kong (China) and International:
Region IDNamecn-hongkongChina (Hong Kong)ap-southeast-1Singaporeap-southeast-3Malaysia (Kuala Lumpur)ap-southeast-5Indonesia (Jakarta)ap-southeast-6Philippines (Manila)ap-southeast-7Thailand (Bangkok)ap-northeast-1Japan (Tokyo)ap-northeast-2South Korea (Seoul)eu-central-1Germany (Frankfurt)eu-west-1UK (London)us-east-1US (Virginia)us-west-1US (Silicon Valley)me-east-1UAE (Dubai)na-south-1Mexico
Interactive pagination:
This step can be combined with Step 1 (task type) to reduce interaction rounds.
InvalidAccessKeyId.NotFound - Invalid AccessKey, check configurationForbidden.RAM - Insufficient RAM permissions, requires AliyunDTSFullAccess policyInvalidParameter - Parameter error, check inputUnSupportedTaskType - Unsupported link combination, suggest changing engine or access methodOperationDenied - Operation denied, task status may not allow this operation--user-agent AlibabaCloud-Agent-Skills parameter (except local configuration commands like aliyun configure)--read-timeout 30 --connect-timeout 10CRITICAL: Before constructing any CLI command, ALL user-provided input parameters must be validated and sanitized to prevent command injection.
Validation rules by parameter type:
ParameterValidation RuleIP addressMust match IPv4 pattern ( ^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$), each octet 0-255PortInteger only, range 1-65535Instance IDAlphanumeric, hyphens, and underscores only ( ^[a-zA-Z0-9_-]+$)Database nameAlphanumeric, underscores, hyphens only ( ^[a-zA-Z0-9_-]+$)Table nameAlphanumeric, underscores, hyphens, dots only ( ^[a-zA-Z0-9_.\-]+$)UsernameAlphanumeric, underscores, hyphens, dots only ( ^[a-zA-Z0-9_.\-]+$)Region IDMust match known Region ID list or pattern ^[a-z]{2}-[a-z]+-?\d*$DtsJobNameAlphanumeric, hyphens, underscores, dots only, max 128 chars
Shell injection prevention:
'...') when passed to CLI commands, not just passwords'), or escape them properly ( '\''); | & $ ` ( ) { } \n) for parameters where they are never valid (IP, port, instance ID, username, database name)--DbList****** in confirmation summaries