移动账户组

PUT/zstack/v1/account-groups/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "moveAccountGroup": {
    "parentUuid": "996c8a1d6f273903b750254a69ec5a7b"
  },
  "systemTags": [],
  "userTags": []
}

上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"moveAccountGroup":{"parentUuid":"996c8a1d6f273903b750254a69ec5a7b"}}' \
http://localhost:8080/zstack/v1/account-groups/efdbcd5b10ee3b9aa6b61f2ec4a0efcb/actions

参数列表

名字类型位置描述可选值起始版本
uuidStringurl账户组 UUID 4.10.0
parentUuid (可选)Stringbody(包含在moveAccountGroup结构中)父账户组 UUID 4.10.0
systemTags (可选)Listbody系统标签 4.10.0
userTags (可选)Listbody用户标签 4.10.0

API返回

返回示例

{
  "inventory": {
    "uuid": "c4f2348db99a4d64ac5319abecff4427",
    "name": "my-group",
    "description": "my-group-description",
    "rootGroupUuid": "c4f2348db99a4d64ac5319abecff4427",
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
名字类型描述起始版本
successboolean请求是否成功4.10.0
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error4.10.0

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10010.6
descriptionString错误的概要描述0.6
detailsString错误的详细信息0.6
elaborationString保留字段,默认为null0.6
opaqueLinkedHashMap保留字段,默认为null0.6
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null0.6

SDK示例

Java SDK

MoveAccountGroupAction action = new MoveAccountGroupAction();
action.uuid = "efdbcd5b10ee3b9aa6b61f2ec4a0efcb";
action.parentUuid = "996c8a1d6f273903b750254a69ec5a7b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
MoveAccountGroupAction.Result res = action.call();

Python SDK

MoveAccountGroupAction action = MoveAccountGroupAction()
action.uuid = "efdbcd5b10ee3b9aa6b61f2ec4a0efcb"
action.parentUuid = "996c8a1d6f273903b750254a69ec5a7b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
MoveAccountGroupAction.Result res = action.call()