Update Quota

PUT/zstack/v1/accounts/quotas/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateQuota": {
    "identityUuid": "4d45e6c7787733979415760d2077fca0",
    "name": "quotaname",
    "value": 20
  },
  "systemTags": [],
  "userTags": []
}

In the example above, 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 '{"updateQuota":{"identityUuid":"4d45e6c7787733979415760d2077fca0","name":"quotaname","value":20}}' \
http://localhost:8080/zstack/v1/accounts/quotas/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
identityUuidStringbody (contained in the updateQuota structure)The UUID of the identity entity (account) 0.6
nameStringbody (contained in the updateQuota structure)Resource name 0.6
valuelongbody (contained in the updateQuota structure)Quota value 0.6
systemTags (Optional)ListbodySystem tags 0.6
userTags (Optional)ListbodyUser tags 0.6

API Response

Response example

{
  "inventory": {
    "name": "quota",
    "identityUuid": "733689237dd9309f81e6a2f76b7c78b1",
    "value": 20
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null on success. For details, see error0.6
inventoryQuotaInventoryFor details, see inventory0.6

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause0.6

inventory

NameTypeDescriptionStarting Version
nameStringResource name0.6
identityUuidStringIdentity UUID (account UUID or user UUID)0.6
identityTypeStringIdentity type (account or user)0.6
valueLongDefault quota value0.6
lastOpDateTimestampLast modification time0.6
createDateTimestampCreation time0.6

SDK Examples

Java SDK

UpdateQuotaAction action = new UpdateQuotaAction();
action.identityUuid = "4d45e6c7787733979415760d2077fca0";
action.name = "quotaname";
action.value = 20;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateQuotaAction.Result res = action.call();

Python SDK

UpdateQuotaAction action = UpdateQuotaAction()
action.identityUuid = "4d45e6c7787733979415760d2077fca0"
action.name = "quotaname"
action.value = 20
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateQuotaAction.Result res = action.call()