Update LDAP Server
Headers
Authorization: OAuth the-session-uuidBody
{
"updateLdapServer": {
"name": "new name"
},
"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 PUT -d '{"updateLdapServer":{"name":"new name"}}' \
http://localhost:8080/zstack/v1/ldap/servers/ddd2491867273e6d8fb7c891faf0413fParameter List
Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
ldapServerUuid | String | url | UUID of the LDAP server |
| 4.3.0 |
name (Optional) | String | body (enclosed in the | Resource name |
| 4.3.0 |
description (Optional) | String | body (enclosed in the | Detailed description of the resource |
| 4.3.0 |
url (Optional) | String | body (enclosed in the | Access URL of the LDAP server |
| 4.3.0 |
base (Optional) | String | body (enclosed in the | Query BaseDN of the LDAP server |
| 4.3.0 |
username (Optional) | String | body (enclosed in the | Username for accessing the LDAP server |
| 4.3.0 |
password (Optional) | String | body (enclosed in the | Password |
| 4.3.0 |
encryption (Optional) | String | body (enclosed in the | Encryption method |
| 4.3.0 |
systemTags (Optional) | List | body | System tags |
| 4.3.0 |
userTags (Optional) | List | body | User tags |
| 4.3.0 |
serverType (Optional) | String | body (enclosed in the | LDAP server type |
| 4.3.0 |
usernameProperty (Optional) | String | body (enclosed in the | The field used as the username when a user logs in to the virtualization platform |
| 4.3.0 |
filter (Optional) | String | body (enclosed in the | The filter used when syncing from the LDAP server, which determines which users need to be synced |
| 4.3.0 |
syncCreatedAccountStrategy (Optional) | String | body (enclosed in the | The strategy for handling newly created users on the LDAP server during synchronization: create a corresponding account or take no action |
| 4.3.0 |
syncDeletedAccountStrategy (Optional) | String | body (enclosed in the | The strategy for handling deleted users on the LDAP server during synchronization: delete the corresponding account, mark as stale, or take no action |
| 4.3.0 |
API Response
Response Example
{
"inventory": {
"uuid": "5c502802c9633f4398e9f286d8187f49",
"name": "new name",
"description": "miao desc",
"url": "ldap://localhost:1888",
"base": "dc=example,dc=com",
"username": "",
"password": "",
"encryption": "None"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.3.0 | |
| error | ErrorCode | Error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 4.3.0 |
| inventory | LdapServerInventory | For details, see inventory | 4.3.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001. | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null. | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists. | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID. Uniquely identifies the resource. | 4.3.0 |
| name | String | Resource name | 4.3.0 |
| type | String | User source type, typically ldap | 4.3.0 |
| description | String | Detailed description of the resource | 4.3.0 |
| url | String | 4.3.0 | |
| base | String | LDAP server access URL | 4.3.0 |
| username | String | Username for accessing the LDAP server | 4.3.0 |
| password | String | Password | 4.3.0 |
| encryption | String | Encryption method | 4.3.0 |
| serverType | String | Server type. Possible values are OpenLdap or WindowsAD. Returns Unknown if the type cannot be determined. | 4.3.0 |
| createDate | Timestamp | Creation time | 4.3.0 |
| lastOpDate | Timestamp | Last modification time | 4.3.0 |
SDK Examples
Java SDK
UpdateLdapServerAction action = new UpdateLdapServerAction();
action.ldapServerUuid = "ddd2491867273e6d8fb7c891faf0413f";
action.name = "new name";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLdapServerAction.Result res = action.call();
Python SDK
UpdateLdapServerAction action = UpdateLdapServerAction()
action.ldapServerUuid = "ddd2491867273e6d8fb7c891faf0413f"
action.name = "new name"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateLdapServerAction.Result res = action.call()