Update HA Policy

PUT/zstack/v1/ha-strategy-condition/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlUUID of the resource. Uniquely identifies the resource 4.7.0
name (optional)Stringbody (contained in the updateHaStrategyCondition structure)Resource name 4.7.0
state (optional)Stringbody (contained in the updateHaStrategyCondition structure)State 4.7.0
systemTags (optional)ListbodySystem tags 4.7.0
userTags (optional)ListbodyUser tags 4.7.0

API Response

Response Example

{
  "inventory": {
    "uuid": "9a01c1cea2793814b8b1bf228a2ff601",
    "name": "test",
    "fencerName": "hostStorageState"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.7.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error4.7.0
inventoryHaStrategyConditionInventoryFor details, see inventory4.7.0

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10014.7.0
descriptionStringBrief description of the error4.7.0
detailsStringDetailed information about the error4.7.0
elaborationStringReserved field. Default is null4.7.0
opaqueLinkedHashMapReserved field. Default is null4.7.0
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists4.7.0

inventory

NameTypeDescriptionStarting Version
uuidStringUUID of the resource. Uniquely identifies the resource4.7.0
nameStringResource name4.7.0
fencerNameStringFencer name4.7.0
stateStringState4.7.0
createDateTimestampCreation time4.7.0
lastOpDateTimestampLast modification time4.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()