Update LDAP config for a virtual server
Updates the LDAP configuration if LDAP is the selected mode of operation.
Specify a virtual server ID of 0 to ensure the global LDAP configuration is updated. If the virtual server specified has a global security context, then the global LDAP configuration will be updated, otherwise the LDAP configuration will be updated for the specified virtual server.
HTTP request syntax (URI)
PATCH <base_URI>/v8/storage/virtual-servers/{virtualServerId}/name-services/ldap
Parameters
Name | Type | Required | Values | Description |
virtualServerId | URI_PARAM | Y | string/number | Specifies either the virtual server object ID or the HNAS storage virtual server ID. |
domain | BODY | N | string | LDAP domain. |
isEnabled | BODY | N | boolean | Controls whether LDAP is enabled or not. |
ldapVersion | BODY | N | integer | LDAP version to use when communicating with the LDAP servers. Accepted values are 2 or 3. Version 3 will be used by default. |
password | BODY | N | string | Password that will be used to communicate with the LDAP servers. |
rebindPeriod | BODY | N | integer | Period in minutes between attempts to rebind to the current LDAP server. |
schema | BODY | N | string | LDAP schema to use. Accepted values are:
|
servers | BODY | N | list of objects | Array of LDAP servers objects |
userName | BODY | N | string | Username that will be used to communicate with the LDAP servers. |
useTls | BODY | N | boolean | Controls whether TLS is used when communicating with LDAP servers or not. |
Return codes
Code | Data | Description |
204 | No Data | LDAP config successfully updated. |
400 | Error Message | Missing or invalid request contents. |
403 | Error Message | Operation forbidden by access level. |
404 | Error Message | Requested resource not found. |
500 | Error message | Error associated with the storage system. |
Any HTTP status code other than 204 indicates that the API did not complete successfully.
Request example: Set the schema, and add 2 LDAP servers and credentials
curl -vk -H "X-Api-Key: zrxvSDAv9x.RIP4gkmKarG3beF.or.4Tc2im7oeqYN88C9XPGHxbXC" https://172.17.11.11:8444/v8/storage/virtual-servers/4/name-services/ldap -X PATCH -d '{"schema":"SFU", "servers":[{"ipAddress":"172.27.128.110", "port":389, "tlsPort":636}, {"ipAddress":"172.27.128.111"}], "userName":"cn=ldap,cn=Users,dc=test,dc=example,dc=com", "password":"ldap"}'
Response example
HTTP/1.1 204 No Content