Update Account

PUT/zstack/v1/accounts/{uuid}

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateAccount": {
    "password": "updatepassword",
    "name": "updatename"
  },
  "systemTags": [],
  "userTags": []
}

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 Example

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

Parameter List

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

  • Enabled
  • Disabled
  • Staled

4.3.0

API Response

Response example

{
  "inventory": {
    "uuid": "ffbf2fac53b83b838d4551edcaff1d39",
    "name": "test",
    "type": "Normal"
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error0.6
inventoryAccountInventoryFor details, see inventory0.6

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringThe detailed error information0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeThe root error, the cause of the current error. This field is null if there is no root error0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe account UUID, uniquely identifying this resource4.0.0
nameStringAccount name4.0.0
descriptionStringDetailed description of the account4.0.0
typestateAccount type4.0.0
statestateAccount state4.0.0
createDateTimestampCreation time4.0.0
lastOpDateTimestampLast modification time4.0.0

SDK Examples

Java SDK

UpdateAccountAction action = new UpdateAccountAction();
action.uuid = "99fcb2ad540c36f09e87c820ac6cb4cb";
action.password = "updatepassword";
action.name = "updatename";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateAccountAction.Result res = action.call();

Python SDK

UpdateAccountAction action = UpdateAccountAction()
action.uuid = "99fcb2ad540c36f09e87c820ac6cb4cb"
action.password = "updatepassword"
action.name = "updatename"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateAccountAction.Result res = action.call()