ZStack Cloud Platform
Single Server, Free Trial for One Year
POST zstack/v1/accountsAuthorization: OAuth the-session-uuid{ "params": { "name": "test", "password": "password", "state": "Enabled" }, "systemTags": [], "userTags": [] }
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to show that these two fields can be included in the body.curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"name":"test","password":"password","state":"Enabled"}}' \ http://localhost:8080/zstack/v1/accounts| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (contained in the params structure) | Resource name | 0.6 | |
| password | String | body (contained in the params structure) | Password | 0.6 | |
| type (optional) | String | body (contained in the params structure) | Account type |
| 0.6 |
| description (optional) | String | body (contained in the params structure) | Detailed description of the resource | 0.6 | |
| resourceUuid (optional) | String | body (contained in the params structure) | Resource UUID | 0.6 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 | |
| tagUuids (optional) | List | body (contained in the params structure) | Tag UUID list | 4.3.0 | |
| state (optional) | String | body (contained in the params structure) | Account state |
| 4.3.0 |
{ "inventory": { "uuid": "77dc15220f71377ea48fa520d40d9169", "name": "test", "type": "Normal" } }| Name | Type | Description | Starting Version |
|---|---|---|---|
| sucess | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventory | AccountInventory | For details, see inventory | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.1001 | 0.6 |
| description | String | A brief description of the error | 0.6 |
| details | String | The detailed error information | 0.6 |
| elaboration | String | Reserved field. Defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Defaults to null | 0.6 |
| cause | ErrorCode | The root error, the cause of the current error. This field is null if there is no root error | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The account UUID, uniquely identifying this resource | 4.0.0 |
| name | String | Account name | 4.0.0 |
| description | String | Detailed description of the account | 4.0.0 |
| type | String | Account type | 4.0.0 |
| state | String | Account state | 4.0.0 |
| createDate | Timestamp | Creation time | 4.0.0 |
| lastOpDate | Timestamp | Last modification time | 4.0.0 |
CreateAccountAction action = new CreateAccountAction(); action.name = "test"; action.password = "password"; action.state = "Enabled"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; CreateAccountAction.Result res = action.call(); CreateAccountAction action = CreateAccountAction() action.name = "test" action.password = "password" action.state = "Enabled" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" CreateAccountAction.Result res = action.call() DELETE zstack/v1/accounts/{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/accounts/0f4d2956d5ef35fc9c51ca45b09ba2bb| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID, uniquely identifying this resource | 0.6 | |
| deleteMode (optional) | String | body | Deletion mode | 0.6 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 |
{ "error": { "code": "SYS.1001", "description": "A message or a operation timeout", "details": "Create VM on KVM timeout after 300s" } }DeleteAccountAction action = new DeleteAccountAction(); action.uuid = "0f4d2956d5ef35fc9c51ca45b09ba2bb"; action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteAccountAction.Result res = action.call();DeleteAccountAction action = DeleteAccountAction() action.uuid = "0f4d2956d5ef35fc9c51ca45b09ba2bb" action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DeleteAccountAction.Result res = action.call()PUT zstack/v1/accounts/{uuid}Authorization: OAuth the-session-uuid{ "updateAccount": { "password": "updatepassword", "name": "updatename" }, "systemTags": [], "userTags": [] }
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to show that these two fields can be included in the body.curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X PUT -d '{"updateAccount":{"password":"updatepassword","name":"updatename"}}' \ http://localhost:8080/zstack/v1/accounts/99fcb2ad540c36f09e87c820ac6cb4cb| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID, uniquely identifying this resource | 0.6 | |
| password (optional) | String | body (contained in the updateAccount structure) | Password | 0.6 | |
| name (optional) | String | body (contained in the updateAccount structure) | Account name | 0.6 | |
| description (optional) | String | body (contained in the updateAccount structure) | Detailed description of the resource | 0.6 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 | |
| oldPassword (optional) | String | body (contained in the updateAccount structure) | 3.6.0 | ||
| state (optional) | String | body (contained in the updateAccount structure) | Account state |
| 4.3.0 |
{ "inventory": { "uuid": "ffbf2fac53b83b838d4551edcaff1d39", "name": "test", "type": "Normal" } }| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventory | AccountInventory | For details, see inventory | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.1001 | 0.6 |
| description | String | A brief description of the error | 0.6 |
| details | String | The detailed error information | 0.6 |
| elaboration | String | Reserved field. Defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Defaults to null | 0.6 |
| cause | ErrorCode | The root error, the cause of the current error. This field is null if there is no root error | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The account UUID, uniquely identifying this resource | 4.0.0 |
| name | String | Account name | 4.0.0 |
| description | String | Detailed description of the account | 4.0.0 |
| type | state | Account type | 4.0.0 |
| state | state | Account state | 4.0.0 |
| createDate | Timestamp | Creation time | 4.0.0 |
| lastOpDate | Timestamp | Last modification time | 4.0.0 |
UpdateAccountAction action = new UpdateAccountAction(); action.uuid = "99fcb2ad540c36f09e87c820ac6cb4cb"; action.password = "updatepassword"; action.name = "updatename"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; UpdateAccountAction.Result res = action.call();UpdateAccountAction action = UpdateAccountAction() action.uuid = "99fcb2ad540c36f09e87c820ac6cb4cb" action.password = "updatepassword" action.name = "updatename" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" UpdateAccountAction.Result res = action.call()