VM Related Interfaces

Update Group Directory

PUT/zstack/v1/update/directory

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateDirectory": {
    "uuid": "66a79f93fd5d3d269302297dc1459f6e",
    "name": "test"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. 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 '{"updateDirectory":{"uuid":"66a79f93fd5d3d269302297dc1459f6e","name":"test"}}' http://localhost:8080/zstack/v1/update/directory

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringbody(contained in updateDirectory structure)Resource UUID, a unique identifier for the resource 4.6.0
nameStringbody(contained in updateDirectory structure)Resource Name 4.6.0
systemTags (optional)ListbodySystem Tags 4.6.0
userTags (optional)ListbodyUser Tags 4.6.0

API Response

Return Example

{
  "inventory": {
    "uuid": "ce9c80c271df30eba545af5b7efc6b09",
    "name": "test",
    "groupName": "admin/first/second",
    "parentUuid": "5cc7f45b66783385b3f4a9d1ef109a5d",
    "rootDirectoryUuid": "57290934e96a305fbdad6ccb33bb64b8",
    "zoneUuid": "b103949274663c19b9675ea6f6505dd5",
    "type": "default"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.6.0
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. For details, see error4.6.0
inventoryVmInstanceInventoryFor details, see inventory4.6.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10014.6.0
descriptionStringBrief description of the error4.6.0
detailsStringDetailed error information4.6.0
elaborationStringReserved field, defaults to null4.6.0
opaqueLinkedHashMapReserved field, defaults to null4.6.0
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null4.6.0

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, a unique identifier for the resource4.6.0
nameStringResource Name4.6.0
groupNameStringGroup4.6.0
parentUuidStringParent Directory UUID4.6.0
rootDirectoryUuidStringRoot Directory UUID4.6.0
zoneUuidStringData Center UUID4.6.0
typeStringDirectory Type4.6.0
createDateTimestampCreation Time4.6.0
lastOpDateTimestampLast Operation Date4.6.0

SDK Examples

Java SDK

UpdateDirectoryAction action = new UpdateDirectoryAction();
action.uuid = "66a79f93fd5d3d269302297dc1459f6e";
action.name = "test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateDirectoryAction.Result res = action.call();

Python SDK

UpdateDirectoryAction action = UpdateDirectoryAction()
action.uuid = "66a79f93fd5d3d269302297dc1459f6e"
action.name = "test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateDirectoryAction.Result res = action.call()