查询统一认证用户来源绑定关系

GET/zstack/v1/account-import/bindings

Headers

Authorization: OAuth the-session-uuid

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/account-import/bindings?q=accountUuid=bcfc6b1c7aaf3a43a39ab4edf8b9107d

可查询字段

运行CLI命令行工具,输入QueryThirdPartyAccountSourceBinding并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例

{
  "inventories": [
    {
      "id": 1,
      "credentials": "ou=Employee,uid=test",
      "accountSourceUuid": "617cef7cda233b559d134245cf8211d5",
      "accountUuid": "f29adf4e230831f3b34f4d4bf7cfa1dc"
    }
  ]
}
名字类型描述起始版本
successbooleanAPI是否成功4.3.0
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error4.3.0
inventoriesList详情参考inventories4.3.0

error

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

inventories

名字类型描述起始版本
idLong唯一标示该关系4.3.0
credentialsString导入源使用的用户唯一标识,例如LDAP源导入的用户则为登录使用的UID4.3.0
accountSourceUuidString导入源服务器UUID4.3.0
accountUuidString账户UUID4.3.0
createDateTimestamp创建时间4.3.0
lastOpDateTimestamp最后一次修改时间4.3.0

SDK示例

Java SDK

QueryThirdPartyAccountSourceBindingAction action = new QueryThirdPartyAccountSourceBindingAction();
action.conditions = asList("accountUuid=5ec5476a24423683ad3f51da0891682e");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryThirdPartyAccountSourceBindingAction.Result res = action.call();

Python SDK

QueryThirdPartyAccountSourceBindingAction action = QueryThirdPartyAccountSourceBindingAction()
action.conditions = ["accountUuid=c02ff535be723284947cad9f679cc1b9"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryThirdPartyAccountSourceBindingAction.Result res = action.call()