查询AD/LDAP绑定(QueryLdapBinding)

API请求

URLs
GET zstack/v1/ldap/bindings
GET zstack/v1/ldap/bindings/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth f114b38ccae244c38cda7ec7dbdd062c" \
-X GET http://localhost:8080/zstack/v1/ldap/bindings?q=accountUuid=f1672bbe810b4b3b89f030f5f51fdb79
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth 43f9144da747462eaa08da071d317c45" \
-X GET http://localhost:8080/zstack/v1/ldap/bindings/9e959125b2f64a86a2a380b335b2543e

可查询字段

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

API返回

返回示例
{
  "inventories": [
    {
      "uuid": "7e7c5818d2bc4d45b61fdbed5c1a64b0",
      "ldapUid": "ou\u003dEmployee,uid\u003dtest",
      "ldapServerUuid": "540e7691df7349c58cff8ffcaf305b9b",
      "accountUuid": "0829b88f337b4500b2ba28936fe5ae3d"
    }
  ]
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 0.6
inventories List 详情参考inventories 0.6
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述5 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6
#inventories
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 0.6
ldapUid String LDAP登录使用的UID 0.6
ldapServerUuid String LDAP服务器UUID 0.6
accountUuid String 账户UUID 0.6
createDate Timestamp 创建时间 0.6
lastOpDate Timestamp 最后一次修改时间 0.6

SDK示例

Java SDK
QueryLdapBindingAction action = new QueryLdapBindingAction();
action.conditions = asList("accountUuid=d5915883c1c04b62af8423f04bb1b3f3");
action.sessionId = "2b7a31a70f7d4e90b0159cd0b9396f26";
QueryLdapBindingAction.Result res = action.call();
Python SDK
QueryLdapBindingAction action = QueryLdapBindingAction()
action.conditions = ["accountUuid=15cdbd6f45bf434492ef22eb2d77b6f4"]
action.sessionId = "4956fb9e5d874e88851634154bda4d4a"
QueryLdapBindingAction.Result res = action.call()