Update HA Policy
Headers
Authorization: OAuth the-session-uuidBody
{
"updateHaStrategyCondition": {
"name": "new ha strategycondition name",
"state": "Enable"
},
"systemTags": [],
"userTags": []
}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 Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateHaStrategyCondition":{"name":"new ha strategycondition name","state":"Enable"}}' http://localhost:8080/zstack/v1/ha-strategy-condition/bf798f9ae94f3007a293f090ec555d57/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the resource. Uniquely identifies the resource | 4.7.0 | |
| name (optional) | String | body (contained in the updateHaStrategyCondition structure) | Resource name | 4.7.0 | |
| state (optional) | String | body (contained in the updateHaStrategyCondition structure) | State | 4.7.0 | |
| systemTags (optional) | List | body | System tags | 4.7.0 | |
| userTags (optional) | List | body | User tags | 4.7.0 |
API Response
Response Example
{
"inventory": {
"uuid": "9a01c1cea2793814b8b1bf228a2ff601",
"name": "test",
"fencerName": "hostStorageState"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.7.0 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 4.7.0 |
| inventory | HaStrategyConditionInventory | For details, see inventory | 4.7.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 4.7.0 |
| description | String | Brief description of the error | 4.7.0 |
| details | String | Detailed information about the error | 4.7.0 |
| elaboration | String | Reserved field. Default is null | 4.7.0 |
| opaque | LinkedHashMap | Reserved field. Default is null | 4.7.0 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists | 4.7.0 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource. Uniquely identifies the resource | 4.7.0 |
| name | String | Resource name | 4.7.0 |
| fencerName | String | Fencer name | 4.7.0 |
| state | String | State | 4.7.0 |
| createDate | Timestamp | Creation time | 4.7.0 |
| lastOpDate | Timestamp | Last modification time | 4.7.0 |
SDK Examples
Java SDK
UpdateHaStrategyConditionAction action = new UpdateHaStrategyConditionAction();
action.uuid = "bf798f9ae94f3007a293f090ec555d57";
action.name = "new ha strategycondition name";
action.state = "Enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateHaStrategyConditionAction.Result res = action.call();Python SDK
UpdateHaStrategyConditionAction action = UpdateHaStrategyConditionAction()
action.uuid = "bf798f9ae94f3007a293f090ec555d57"
action.name = "new ha strategycondition name"
action.state = "Enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateHaStrategyConditionAction.Result res = action.call()