云数据库 RDS-获取指定ID的任务信息 - ListJobInfo:响应消息

时间:2025-12-17 15:27:42

响应消息

  • 正常响应要素说明
    表2 参数说明

    名称

    参数类型

    说明

    job

    Object

    参数解释

    任务信息,请参见表3

    表3 job字段数据结构说明

    名称

    参数类型

    说明

    id

    String

    参数解释

    任务ID。

    取值范围

    不涉及。

    name

    String

    参数解释

    任务名称。

    取值范围

    不涉及。

    status

    String

    参数解释

    任务执行状态。

    取值范围
    • Running:表示任务正在执行。
    • Completed:表示任务执行成功。
    • Failed:表示任务执行失败。

    created

    String

    参数解释

    创建时间。

    取值范围

    格式为“yyyy-mm-ddThh:mm:ssZ”。

    其中,T指某个时间的开始;Z指时区偏移量,例如北京时间偏移显示为+0800。

    ended

    String

    参数解释

    结束时间。

    取值范围

    格式为“yyyy-mm-ddThh:mm:ssZ”。

    其中,T指某个时间的开始;Z指时区偏移量,例如北京时间偏移显示为+0800。

    process

    String

    参数解释

    任务执行进度。

    取值范围

    执行中状态才返回执行进度,例如“60%”,表示任务执行进度为60%,否则返回""。

    instance

    Object

    参数解释

    执行任务的实例信息。

    请参见表4

    entities

    Object

    参数解释

    根据不同的任务,显示不同的内容。

    请参见表表5

    说明:

    未有entities字段说明的异步任务,返回为{}。

    fail_reason

    String

    参数解释

    任务执行失败时的错误信息。

    取值范围

    不涉及。

    表4 instances字段数据结构说明

    名称

    参数类型

    说明

    id

    String

    参数解释

    实例ID。

    取值范围

    不涉及。

    name

    String

    参数解释

    实例名称。

    取值范围

    不涉及。

    表5 entities字段数据结构说明

    名称

    参数类型

    说明

    instance

    Object

    参数解释

    创建实例,单转主备,创建只读实例任务想要实现的实例信息。

    请参见表6

    resource_ids

    Array of strings

    参数解释

    任务涉及到的资源ID。

    取值范围

    不涉及。

    volume

    Object

    参数解释

    调整实例容量任务的磁盘信息。

    详情请参见表8

    public_ip

    String

    参数解释

    任务实现的弹性公网IP。

    取值范围

    不涉及。

    switch_strategy

    String

    参数解释

    主备倒换策略。

    取值范围

    不涉及。

    表6 entities.instance字段数据结构说明

    名称

    参数类型

    说明

    endpoint

    String

    参数解释

    实例的连接地址。

    取值范围

    不涉及。

    type

    String

    参数解释

    实例类型。

    取值范围

    • Single:单机实例。
    • Ha:主备实例。
    • Replica:只读实例。

    datastore

    Object

    参数解释

    数据库信息,请参见表7

    replica_of

    String

    参数解释

    主实例ID,仅创建只读实例的时候返回。

    取值范围

    不涉及。

    表7 datastore字段数据结构说明

    名称

    参数类型

    说明

    type

    String

    参数解释

    数据库引擎。

    取值范围

    • mysql
    • postgresql
    • sqlserver

    version

    String

    参数解释

    数据库版本。

    取值范围

    不涉及。

    表8 volume字段数据结构说明

    名称

    参数类型

    说明

    type

    String

    参数解释

    磁盘类型。

    取值范围

    • ULTRAHIGH,表示超高IO型磁盘。
    • LOCALSSD,表示本地SSD盘。
    • CLOUDSSD,表示SSD云盘,仅支持通用型和独享型规格实例。
    • ESSD,表示极速型SSD。

    original_size

    String

    参数解释

    实例原本的磁盘大小(单位:GB)。

    取值范围

    不涉及。

    target_size

    String

    参数解释

    任务的目标磁盘大小(单位:GB)。

    取值范围

    不涉及。

    响应样例中取任务中心部分任务作为示例。

  • 正常响应样例
    创建实例:
    {
    	"job": {
    		"id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": "CreateMysqlSingleHAInstance",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"ended": "2018-08-06T16: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"]
    		}
    	}
    }
    创建只读实例:
    {
    	"job": {
    		"id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": " CreateMysqlReplicaInstance",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"ended": "2018-08-06T16: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"]
    		}
    	}
    }
    绑定弹性公网IP:
    {
    	"job": {
    		"id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": "MysqlBindEIP",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"ended": "2018-08-06T16:41:14+0000",
    		"process": "",
    		"instance": {
    			"id": "a48e43ff268f4c0e879652d65e63d0fbin01",
    			"name": "DO-NOT-TOUCH-mgr2-mysql-single"
    		},
    		"entities": {
    			"public_ip": "10.10.10.1"
    		}
    	}
    }
    重启实例:
    {
    	"job": {
    		"id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886",
    		"name": " RestartMysqlInstance",
    		"status": "Completed",
    		"created": "2018-08-06T10:41:14+0000",
    		"ended": "2018-08-06T16:41:14+0000",
    		"process": "",
    		"instance": {
    			"id": "a48e43ff268f4c0e879652d65e63d0fbin01",
    			"name": "DO-NOT-TOUCH-mgr2-mysql-single"
    		},
    		"entities": {}
    	}
    }
    任务正在执行中:
    {
    	"job": {
    		"id": "31 b8ae23 - c687 - 4 d80 - b7b4 - 42 a66c9bb886",
    		"name": "CreateMysqlSingleHAInstance”,“ status”: “Running",
    		"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"
    				}
    			}
    		}
    	}
    }
    任务执行失败:
    {
    	"job": {
    		"id": "31 b8ae23 - c687 - 4 d80 - b7b4 - 42 a66c9bb886",
    		"name": "CreateMysqlSingleHAInstance",
    		"status": "Failed",
    		"created": "2018-08-06T10:41:14+0000",
    		"ended": "2018-08-06T16: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."
    	}
    }
  • 异常响应

    请参见异常请求结果

support.huaweicloud.com/api-rds/rds_08_0001.html