ZStack Cloud Platform
Single Server, Free Trial for One Year
POST zstack/v1/cbt-task/createAuthorization: OAuth the-session-uuid{ "params": { "name": "My CDP Task", "vmInstanceUuid": "89878e17496030ba9c062cbb18924335" }, "systemTags": [], "userTags": [] }
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"name":"My CDP Task","vmInstanceUuid":"89878e17496030ba9c062cbb18924335"}}' \ http://localhost:8080/zstack/v1/cbt-task/create| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (included in the params structure) | Resource name | 4.10.10 | |
| description (optional) | String | body (included in the params structure) | Detailed description of the resource | 4.10.10 | |
| taskType | String | body (included in the params structure) | 4.10.10 | ||
| resourceUuids | List | body (included in the params structure) | 4.10.10 | ||
| resourceUuid (optional) | String | body (included in the params structure) | Resource UUID | 4.10.10 | |
| tagUuids (optional) | List | body (included in the params structure) | Tag UUID list | 4.10.10 | |
| systemTags (optional) | List | body | System tags | 4.10.10 | |
| userTags (optional) | List | body | User tags | 4.10.10 |
{ "inventory": { "uuid": "b70f4160919c38748f908f489ba306ce", "name": "My Task", "status": "Created" } }| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 5.3.20 | |
| inventory | CbtTaskInventory | For details, see inventory | 5.3.20 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 5.3.20 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID. Uniquely identifies the resource | 4.10.10 |
| name | String | Resource name | 4.10.10 |
| description | String | Detailed description of the resource | 4.10.10 |
| createDate | Timestamp | Creation time | 4.10.10 |
| lastOpDate | Timestamp | Last modification time | 4.10.10 |
| status | CbtTaskStatus | For details, see status | 4.10.10 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Created | CbtTaskStatus | 4.10.10 | |
| Starting | CbtTaskStatus | 4.10.10 | |
| Running | CbtTaskStatus | 4.10.10 | |
| Stopped | CbtTaskStatus | 4.10.10 | |
| Failed | CbtTaskStatus | 4.10.10 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if there is no source error | 0.6 |
CreateCbtTaskAction action = new CreateCbtTaskAction(); action.name = "My CDP Task"; action.vmInstanceUuid = "89878e17496030ba9c062cbb18924335"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; CreateCbtTaskAction.Result res = action.call();CreateCbtTaskAction action = CreateCbtTaskAction() action.name = "My CDP Task" action.vmInstanceUuid = "89878e17496030ba9c062cbb18924335" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" CreateCbtTaskAction.Result res = action.call()DELETE zstack/v1/cbt-task/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/cbt-task/7017b8d5bef63877a528a5f56517c829| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID. Uniquely identifies the resource | 4.10.10 | |
| force (optional) | boolean | body | 4.10.10 | ||
| deleteMode (optional) | String | body | Deletion mode (Permissive / Enforcing, Permissive) | 4.10.10 | |
| systemTags (optional) | List | body | System tags | 4.10.10 | |
| userTags (optional) | List | body | User tags | 4.10.10 |
{}. On failure, the returned JSON structure contains an error field, for example:{ "error": { "code": "SYS.1001", "description": "A message or a operation timeout", "details": "Create VM on KVM timeout after 300s" } }DeleteCbtTaskAction action = new DeleteCbtTaskAction(); action.uuid = "7017b8d5bef63877a528a5f56517c829"; action.force = false; action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteCbtTaskAction.Result res = action.call();DeleteCbtTaskAction action = DeleteCbtTaskAction() action.uuid = "7017b8d5bef63877a528a5f56517c829" action.force = false action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DeleteCbtTaskAction.Result res = action.call()POST zstack/v1/cbt-task/disable/{uuid}Authorization: OAuth the-session-uuid{ "params": { "force": false }, "systemTags": [], "userTags": [] }
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"force":false}}' \ http://localhost:8080/zstack/v1/cbt-task/disable/5a86262807b4363e95f2e57d2970d189| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID. Uniquely identifies the resource | 4.10.10 | |
| force (optional) | boolean | body (included in the params structure) | 4.10.10 | ||
| systemTags (optional) | List | body | System tags | 4.10.10 | |
| userTags (optional) | List | body | User tags | 4.10.10 |
{ "inventory": { "uuid": "5ca9c15a50c53f0dac359a64841d7b2b", "name": "My Task", "status": "Stopped" } }| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.10.10 | |
| inventory | CbtTaskInventory | For details, see inventory | 4.10.10 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 4.10.10 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID. Uniquely identifies the resource | 4.10.10 |
| name | String | Resource name | 4.10.10 |
| description | String | Detailed description of the resource | 4.10.10 |
| createDate | Timestamp | Creation time | 4.10.10 |
| lastOpDate | Timestamp | Last modification time | 4.10.10 |
| status | CbtTaskStatus | For details, see status | 4.10.10 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Created | CbtTaskStatus | 4.10.10 | |
| Starting | CbtTaskStatus | 4.10.10 | |
| Running | CbtTaskStatus | 4.10.10 | |
| Stopped | CbtTaskStatus | 4.10.10 | |
| Failed | CbtTaskStatus | 4.10.10 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if there is no source error | 0.6 |
DisableCbtTaskAction action = new DisableCbtTaskAction(); action.uuid = "5a86262807b4363e95f2e57d2970d189"; action.force = false; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DisableCbtTaskAction.Result res = action.call();DisableCbtTaskAction action = DisableCbtTaskAction() action.uuid = "5a86262807b4363e95f2e57d2970d189" action.force = false action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DisableCbtTaskAction.Result res = action.call()