Query LDAP Server

GET/zstack/v1/ldap/servers
GET/zstack/v1/ldap/servers/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ldap/servers?q=name=ldap server
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ldap/servers/68ff5ef58b4634dba740b26db67d3b01

Queryable Fields

Run the CLI command line tool, enter QueryLdapServer and press the Tab key to view all queryable fields and cross-table queryable resource names.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "fea82960cbaa33bb9f3de91c8054af8d",
      "name": "miao",
      "description": "miao desc",
      "url": "ldap://localhost:1888",
      "base": "dc=example,dc=com",
      "username": "",
      "password": "",
      "encryption": "None"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.3.0
errorErrorCodeError code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error4.3.0
inventoriesListFor details, see inventories4.3.0

error

NameTypeDescriptionStarting Version
codeStringError code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001.0.6
descriptionStringBrief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null.0.6
opaqueLinkedHashMapReserved field. Default is null.0.6
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists.0.6

inventories

NameTypeDescriptionStarting Version
uuidLongResource UUID. Uniquely identifies the resource.4.3.0
nameStringResource name4.3.0
typeStringUser source type, typically ldap4.3.0
descriptionStringDetailed description of the resource4.3.0
urlString 4.3.0
baseStringLDAP server access URL4.3.0
usernameStringUsername for accessing the LDAP server4.3.0
passwordStringPassword4.3.0
encryptionStringEncryption method4.3.0
serverTypeStringServer type. Possible values are OpenLdap or WindowsAD. Returns Unknown if the type cannot be determined.4.3.0
createDateTimestampCreation time4.3.0
lastOpDateTimestampLast modification time4.3.0

SDK Examples

Java SDK

QueryLdapServerAction action = new QueryLdapServerAction();
action.conditions = asList("name=ldap server");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryLdapServerAction.Result res = action.call();

Python SDK

QueryLdapServerAction action = QueryLdapServerAction()
action.conditions = ["name=ldap server"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryLdapServerAction.Result res = action.call()