查询AD/LDAP服务器(QueryLdapServer)
API请求
URLs
GET zstack/v1/ldap/servers
GET zstack/v1/ldap/servers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth 940b9dba281d40b897497a95e8a0e942" \
-X GET http://localhost:8080/zstack/v1/ldap/servers?q=name=ldap server
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth e4e74e66dc074b24b7071b43b12240a2" \
-X GET http://localhost:8080/zstack/v1/ldap/servers/c898d74cdcb94ac4b3b28ac6b7a8f7f5
可查询字段zstack-cli
运行命令行工具,输入QueryLdapServer并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"uuid": "91820f68407a441c9ba031ac15fa322d",
"name": "miao",
"description": "miao desc",
"url": "ldap://localhost:1888",
"base": "dc\u003dexample,dc\u003dcom",
"username": "",
"password": "",
"encryption": "None"
}
]
}
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
inventories | List | 详情参考inventories | 0.6 |
#error
名字 | 类型 | 描述 | 起始版本 |
---|---|---|---|
code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
description | String | 错误的概要描述 | 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 |
name | String | 资源名称 | 0.6 |
description | String | 资源的详细描述 | 0.6 |
url | String | 0.6 | |
base | String | LDAP服务器访问地址 | 0.6 |
username | String | 用于访问LDAP服务器的用户名 | 0.6 |
password | String | 密码 | 0.6 |
encryption | String | 加密方式 | 0.6 |
createDate | Timestamp | 创建时间 | 0.6 |
lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
SDK示例
Java
SDK
QueryLdapServerAction action = new QueryLdapServerAction();
action.conditions = asList("name=ldap server");
action.sessionId = "a8d28261d5b940c9bdd4712a511bd537";
QueryLdapServerAction.Result res = action.call();
Python
SDK
QueryLdapServerAction action = QueryLdapServerAction()
action.conditions = ["name=ldap server"]
action.sessionId = "aee6bc43a2fb4f1eb6c35e3a064dd464"
QueryLdapServerAction.Result res = action.call()