Update Resource Custom Attribute

PUT/zstack/v1/resource-configurations/{category}/{name}/{resourceUuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateResourceConfig": {
    "value": "10"
  },
  "systemTags": [],
  "userTags": []
}

In the above example, the systemTags and userTags fields are optional. They are listed to indicate 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 '{"updateResourceConfig":{"value":"10"}}' http://localhost:8080/zstack/v1/resource-configurations/host/cpu.overProvisioning.ratio/afd5f67a253b4990b9e8160672357eed/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
categoryStringurlConfiguration category 3.4.0
nameStringurlConfiguration name 3.4.0
resourceUuidStringurlResource UUID of the configuration 3.4.0
valueStringbody (Included in the updateResourceConfig structure)The configuration value 3.4.0
systemTags (Optional)Listbody  3.4.0
userTags (Optional)Listbody  3.4.0

API Response

Response Example

{
  "inventory": {
    "uuid": "ce61962673574ff689e2e6cb6f8cf558",
    "resourceUuid": "435a7c71c82b4b0b971f4674ab346822",
    "resourceType": "ClusterVO",
    "name": "cpu.overProvisioning.ratio",
    "category": "host",
    "value": "10",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details3.4.0
inventoryResourceConfigInventorySee inventory for details3.4.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10013.4.0
descriptionStringA brief description of the error3.4.0
detailsStringThe detailed error information3.4.0
elaborationStringReserved field. Default is null3.4.0
opaqueLinkedHashMapReserved field. Default is null3.4.0
causeErrorCodeThe root error that caused the current error. If no root error exists, this field is null3.4.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource, uniquely identifying the resource3.4.0
resourceUuidStringThe resource UUID associated with the configuration3.4.0
resourceTypeStringThe resource type associated with the configuration3.4.0
nameStringConfiguration name3.4.0
descriptionStringThe detailed description of the configuration3.4.0
categoryStringConfiguration category3.4.0
valueStringThe configuration value3.4.0
createDateTimestampCreation time3.4.0
lastOpDateTimestampLast modification time3.4.0

SDK Examples

Java SDK

UpdateResourceConfigAction action = new UpdateResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "5fa296dff4f04c96b29f38bef93e9e15";
action.value = "10";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateResourceConfigAction.Result res = action.call();

Python SDK

UpdateResourceConfigAction action = UpdateResourceConfigAction()
action.category = "host"
action.name = "cpu.overProvisioning.ratio"
action.resourceUuid = "1e0f389aca364a1f94929bb4f39597b3"
action.value = "10"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateResourceConfigAction.Result res = action.call()