Get Resource Custom Attribute

GET/zstack/v1/resource-configurations/{resourceUuid}/{category}/{name}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/resource-configurations/77663dd5ff84460bbf1817aa3c59d125/host/cpu.overProvisioning.ratio

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
categoryStringurlConfiguration category 3.4.0
nameStringurlConfiguration name 3.4.0
resourceUuidStringurlResource UUID 3.4.0
systemTags (Optional)Listquery  3.4.0
userTags (Optional)Listquery  3.4.0

API Response

Response Example

{
  "value": "5",
  "effectiveConfigs": [
    {
      "uuid": "dae9aeb6d74e4f44823f2e0c4f1cc79f",
      "resourceUuid": "46597de31eac41539c4e6eda52885769",
      "resourceType": "HostVO",
      "name": "cpu.overProvisioning.ratio",
      "category": "host",
      "value": "5",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    },
    {
      "uuid": "5c3c94a73d7b4a95a1818241f2e427ae",
      "resourceUuid": "371519310f344695854de27bb9743121",
      "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
valueStringThe configuration value3.4.0
successboolean 3.4.0
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details3.4.0
effectiveConfigsListThe list of effective configurations, sorted by priority from high to low. See effectiveConfigs for details3.4.0
errorErrorCodeSee error 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

effectiveConfigs

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

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

SDK Examples

Java SDK

GetResourceConfigAction action = new GetResourceConfigAction();
action.category = "host";
action.name = "cpu.overProvisioning.ratio";
action.resourceUuid = "70fdcc564f564c29af98e48e78be56e4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetResourceConfigAction.Result res = action.call();

Python SDK

GetResourceConfigAction action = GetResourceConfigAction()
action.category = "host"
action.name = "cpu.overProvisioning.ratio"
action.resourceUuid = "b1ea1d424bf04a50b15b33bcd0f8a80d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetResourceConfigAction.Result res = action.call()