Create LDAP Binding

POST/zstack/v1/ldap/bindings

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "ldapUid": "ou=Employee,uid=test",
    "accountUuid": "ed7d933c7a6d37fb9bd444140faeec5c"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding example, the systemTags and userTags fields are optional. They are listed here to show that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"ldapUid":"ou=Employee,uid=test","accountUuid":"ed7d933c7a6d37fb9bd444140faeec5c"}}' \
http://localhost:8080/zstack/v1/ldap/bindings

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
ldapUidStringbody (enclosed in the params structure)LDAP UID 4.3.0
accountUuidStringbody (enclosed in the params structure)Account UUID 4.3.0
ldapServerUuid (Optional)Stringbody (enclosed in the params structure)LDAP server UUID. If not specified, the system selects the UUID of the currently active LDAP server. 4.3.0
systemTags (Optional)ListbodySystem tags 4.3.0
userTags (Optional)ListbodyUser tags 4.3.0

API Response

Response Example

{
  "inventory": {
    "id": 1,
    "credentials": "ou=Employee,uid=test",
    "accountSourceUuid": "41006790733e38db9ce810878e19f8a3",
    "accountUuid": "3be58c2832a939bf9bce2ea959e04ce8"
  }
}
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
inventoryImportAccountRefInventoryFor details, see inventory4.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

inventory

NameTypeDescriptionStarting Version
idLongUniquely identifies the relationship4.3.0
credentialsStringUnique identifier of the user from the import source. For example, for users imported from an LDAP source, this is the UID used for login.4.3.0
accountSourceUuidStringImport source server UUID4.3.0
accountUuidStringAccount UUID4.3.0
createDateTimestampCreation time4.3.0
lastOpDateTimestampLast modification time4.3.0

SDK Examples

Java SDK

CreateLdapBindingAction action = new CreateLdapBindingAction();
action.ldapUid = "ou=Employee,uid=test";
action.accountUuid = "ed7d933c7a6d37fb9bd444140faeec5c";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateLdapBindingAction.Result res = action.call();

Python SDK

CreateLdapBindingAction action = CreateLdapBindingAction()
action.ldapUid = "ou=Employee,uid=test"
action.accountUuid = "ed7d933c7a6d37fb9bd444140faeec5c"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateLdapBindingAction.Result res = action.call()