Updated on 2026-01-06 GMT+08:00

Obtaining Information About a Task with a Specified ID

Function

This API is used to obtain information about a task with a specified ID in the task center.

Constraints

  • RDS jobs are asynchronous. After a job is generated, it takes several seconds to query the job ID.
  • This API is used to query only asynchronous tasks of the last one month in the task center.
  • Information of the following asynchronous tasks can be obtained: creating a single-node or primary/standby DB instance, creating a read replica, deleting a DB instance, changing a single-node DB instance to primary/standby DB instance, switching a primary/standby DB instance, scaling up storage space, binding or unbinding an EIP, and changing an instance class.

URI

  • URI format

    GET /v3/{project_id}/jobs?id={id}

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Explanation:

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    Constraints:

    N/A

    Value range:

    N/A

    Default value:

    N/A

    id

    Yes

    Explanation:

    Task ID.

    Constraints:

    N/A

    Value range:

    N/A

    Default value:

    N/A

Request

  • Request parameters

    None

  • URI example

    GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/jobs?id=a9767ede-fe0f-4888-9003-e843a4c90514

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    job

    Object

    Explanation:

    Indicates the task information. For details, see Table 3.

    Table 3 job field data structure description

    Parameter

    Type

    Description

    id

    String

    Explanation:

    Indicates the job ID.

    Value range:

    N/A

    name

    String

    Explanation:

    Indicates the task name.

    Value range:

    N/A

    status

    String

    Explanation:

    Indicates the task execution status.

    Value range:
    • Running: The task is being executed.
    • Completed: The task is successfully executed.
    • Failed: The task fails to be executed.

    created

    String

    Explanation:

    Indicates the creation time.

    Value range:

    The value is in the "yyyy-mm-ddThh:mm:ssZ" format.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset.

    process

    String

    Explanation:

    Indicates the task execution progress.

    Value range:

    The execution progress (such as "60%") is displayed only when the task is being executed. Otherwise, "" is returned.

    instance

    Object

    Explanation:

    Indicates information of the DB instance on which the task is executed.

    For details, see Table 4.

    entities

    Object

    Explanation:

    The displayed information varies depending on the tasks.

    For details, see the following:

    NOTE:

    For asynchronous tasks without the entities field description, {} is returned.

    fail_reason

    String

    Explanation:

    Indicates the error information displayed when a task failed.

    Value range:

    N/A

    Table 4 instances field data structure description

    Parameter

    Type

    Description

    id

    String

    Explanation:

    Indicates the DB instance ID.

    Value range:

    N/A

    name

    String

    Explanation:

    Indicates the DB instance name.

    Value range:

    N/A

    Table 5 entities field data structure description (creating DB instances, changing single DB instances to primary/standby, or creating read replicas)

    Parameter

    Type

    Description

    instance

    Object

    Explanation:

    Indicates the information about the queried DB instance.

    For details, see Table 6.

    resource_ids

    List<String>

    Explanation:

    Indicates the queried resource ID.

    Value range:

    N/A

    Table 6 entities.instance field data structure description

    Parameter

    Type

    Description

    endpoint

    String

    Explanation:

    Indicates the DB instance connection address.

    Value range:

    N/A

    type

    String

    Explanation:

    Indicates the DB instance type.

    Value range:

    • Single: single-node instance
    • Ha: primary/standby instance
    • Replica: read replica

    datastore

    Object

    Explanation:

    Indicates the database information. For details, see Table 7.

    replica_of

    String

    Explanation:

    Indicates the primary DB instance ID. This parameter is returned only when a read replica is created.

    Value range:

    N/A

    Table 7 datastore field data structure description

    Parameter

    Type

    Description

    type

    String

    Explanation:

    Indicates the DB engine.

    Value range:

    N/A

    version

    String

    Explanation:

    Indicates the database version.

    Value range:

    N/A

    Table 8 entities field data structure description (resizing a DB instance)

    Parameter

    Type

    Description

    volume

    Object

    Explanation:

    Indicates the information about the resized disk.

    For details, see Table 9.

    resource_ids

    List<String>

    Explanation:

    Indicates the queried resource ID.

    Value range:

    N/A

    Table 9 volume field data structure description

    Parameter

    Type

    Description

    type

    String

    Explanation:

    Indicates the volume type.

    Value range:

    N/A

    original_size

    String

    Explanation:

    Indicates the original volume size in GB.

    Value range:

    N/A

    target_size

    String

    Explanation:

    Indicates the target volume size in GB.

    Value range:

    N/A

    Table 10 entities field data structure description (binding/unbinding EIPs or enabling/disabling remote access)

    Parameter

    Type

    Description

    public_ip

    String

    Explanation:

    Indicates the EIP bound to the DB instance.

    Value range:

    N/A

    Table 11 entities field data structure description (primary/standby switchover)

    Parameter

    Type

    Description

    switch_strategy

    String

    Explanation:

    Indicates the primary/standby switchover policy.

    Value range:

    N/A

    In the response example, some tasks in the task center are used as examples.

  • Example normal response
    Creating a DB instance:
    {
    	"job": {
    		"id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": "CreateMysqlSingleHAInstance",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"process": "",
    		"instance": {
    			"id": "a48e43ff268f4c0e879652d65e63d0fbin01",
    			"name": "DO-NOT-TOUCH-mgr2-mysql-single"
    		},
    		"entities": {
    			"instance": {
    				"endpoint": "192.168.1.203:3306",
    				"type": "Single",
    				"datastore": {
    					"type": "mysql",
    					"version": "5.7"
    				}
    			},
    			"resource_ids": ["a48e43ff268f4c0e879652d65e63d0fbin01.vm", "a48e43ff268f4c0e879652d65e63d0fbin01.volume"]
    		}
    	}
    }
    Creating a read replica:
    {
    	"job": {
    		"id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": " CreateMysqlReplicaInstance",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"process": "",
    		"instance": {
    			"id": "288caaa9d05f4ec1a1f58de2e0945685in01",
    			"name": "mysql-replica"
    		},
    		"entities": {
    			"instance": {
    				"endpoint": "192.168.1.203:3306",
    				"type": "replica",
    				"datastore": {
    					"type": "mysql",
    					"version": "5.7"
    				},
    				"replica_of": "a48e43ff268f4c0e879652d65e63d0fbin01"
    			},
    			"resource_ids": ["288caaa9d05f4ec1a1f58de2e0945685in01.vm", "288caaa9d05f4ec1a1f58de2e0945685in01.volume"]
    		}
    	}
    }
    Binding an EIP:
    {
    	"job": {
    		"id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": "MysqlBindEIP",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"process": "",
    		"instance": {
    			"id": "a48e43ff268f4c0e879652d65e63d0fbin01",
    			"name": "DO-NOT-TOUCH-mgr2-mysql-single"
    		},
    		"entities": {
    			"public_ip": "10.10.10.1"
    		}
    	}
    }
    Rebooting a DB instance:
    {
    	"job": {
    		"id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": " RestartMysqlInstance",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"process": "",
    		"instance": {
    			"id": "a48e43ff268f4c0e879652d65e63d0fbin01",
    			"name": "DO-NOT-TOUCH-mgr2-mysql-single"
    		},
    		"entities": {}
    	}
    }
    Task being executed:
    {
    	"job": {	
                    "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": "CreateMysqlSingleHAInstance",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"process": "60% ",
    		"instance": {
    			"id": "a48e43ff268f4c0e879652d65e63d0fbin01",
    			"name": "DO-NOT-TOUCH-mgr2-mysql-single"
    		},
    		"entities": {
    			"instance": {
    				"type": "Single",
    				"datastore": {
    					"type": "mysql",
    					"version": "5.7"
    				}
    			}
    		}
    	}
    }
    Task fails to be executed:
    {
    	"job": {
    		"id": "31 b8ae23 - c687 - 4 d80 - b7b4 - 42 a66c9bb886",
    		"name": "CreateMysqlSingleHAInstance",
    		"status": "Failed",
    		"created": "2018-08-06T10:41:14+0000",
    		"process": "",
    		"instance": {
    			"id": "a48e43ff268f4c0e879652d65e63d0fbin01",
    			"name": "DO-NOT-TOUCH-mgr2-mysql-single"
    		},
    		"entities": {
    			"instance": {
    				"type": "Single",
    				"datastore": {
    					"type": "mysql",
    					"version": "5.7"
    				}
    			}
    		},
    		"fail_reason": "createVM failed."
    	}
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.