Change Host Password
Headers
Authorization: OAuth the-session-uuidBody
{
"changeHostPassword": {
"password": "hiddenPassword"
},
"systemTags": [],
"userTags": []
}In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeHostPassword":{"password":"hiddenPassword"}}' \
http://localhost:8080/zstack/v1/hosts/kvm/1a6da92b79993cee8b90eef5e727bce2/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| hostUuid | String | url | Host UUID | 3.8 | |
| password | String | body (contained in the changeHostPassword structure) | Password | 3.8 | |
| systemTags (Optional) | List | body | 3.8 | ||
| userTags (Optional) | List | body | 3.8 |
API Response
On success, this API returns an empty JSON structure {}. On error, 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"
}
}SDK Examples
Java SDK
ChangeHostPasswordAction action = new ChangeHostPasswordAction();
action.hostUuid = "1a6da92b79993cee8b90eef5e727bce2";
action.password = "hiddenPassword";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeHostPasswordAction.Result res = action.call();Python SDK
ChangeHostPasswordAction action = ChangeHostPasswordAction()
action.hostUuid = "1a6da92b79993cee8b90eef5e727bce2"
action.password = "hiddenPassword"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeHostPasswordAction.Result res = action.call()