UpdateDirectory
API Request
URLs
PUT zstack/v1/update/directoryHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"updateDirectory": {
"uuid": "66a79f93fd5d3d269302297dc1459f6e",
"name": "test"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
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/directoryRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | body (contained in the params structure) | The resource UUID. | 4.6.0 | |
| name | String | body (contained in the params structure) | The resource name. | 4.6.0 | |
| systemTags | List | body | Optional. The system tags. | 4.6.0 | |
| userTags | List | body | Optional. The user tags. | 4.6.0 |
API Response
Sample
Response
{
"inventory": {
"uuid": "ce9c80c271df30eba545af5b7efc6b09",
"name": "test",
"groupName": "admin/first/second",
"parentUuid": "5cc7f45b66783385b3f4a9d1ef109a5d",
"rootDirectoryUuid": "57290934e96a305fbdad6ccb33bb64b8",
"zoneUuid": "b103949274663c19b9675ea6f6505dd5",
"type": "default"
}
}#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.6.0 |
| description | String | The brief description of the error. | 4.6.0 |
| details | String | The details about the error. | 4.6.0 |
| elaboration | String | The reserved field. Default value: null. | 4.6.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.6.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.6.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.6.0 |
| name | String | The resource name. | 4.6.0 |
| groupName | String | The name of the group that the directory is affiliated to. | 4.6.0 |
| parentUuid | String | The parent directory UUID. | 4.6.0 |
| rootDirectoryUuid | String | The root directory UUID. | 4.6.0 |
| zoneUuid | String | The zone UUID. | 4.6.0 |
| type | String | The directory type. | 4.6.0 |
| createDate | Timestamp | The creation time. | 4.6.0 |
| lastOpDate | Timestamp | The last operation time. | 4.6.0 |
SDK Sample
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()