Queries the settings of Lightweight Directory Access Protocol (LDAP) authentication on a bastion host.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Name Type Required Example Description
Action String Yes GetInstanceLDAPAuthServer

The operation that you want to perform. Set the value to GetInstanceLDAPAuthServer.

InstanceId String Yes bastionhost-cn-st220aw****

The ID of the bastion host.

Note You can call the DescribeInstances operation to query the ID of the bastion host.
RegionId String No cn-hangzhou

The region ID of the bastion host.

Note For more information about the mapping between region IDs and region names, see Regions and zones.

Response parameters

Parameter Type Example Description
RequestId String 1C60E741-102D-5E8F-9710-B06D3F0183FE

The ID of the request, which is used to locate and troubleshoot issues.

LDAP Object

The settings of LDAP authentication.

Account String cn=Manager,dc=test,dc=com

The account of the LDAP server.

BaseDN String dc=test,dc=com

The Base distinguished name (DN).

EmailMapping String emailAttr

The field that is used to indicate the email address of a user on the LDAP server.

Filter String (&(objectClass=top))

The condition that is used to filter users.

IsSSL Boolean true

Indicates whether SSL is supported. Valid values:

  • true: supported
  • false: not supported
LoginNameMapping String userNameAttr

The field that is used to indicate the logon name of a user on the LDAP server.

MobileMapping String mobileAttr

The field that is used to indicate the mobile phone number of a user on the LDAP server.

NameMapping String nameAttr

The field that is used to indicate the name of a user on the LDAP server.

HasPassword String true

Indicates whether passwords are required. Valid values:

  • true: required
  • false: not required
Port Long 389

The port that is used to access the LDAP server.

Server String 192.168.XX.XX

The address of the LDAP server.

StandbyServer String 192.168.XX.XX

The address of the secondary LDAP server.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetInstanceLDAPAuthServer
&InstanceId=bastionhost-cn-st220aw****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetInstanceLDAPAuthServerResponse>
    <RequestId>1C60E741-102D-5E8F-9710-B06D3F0183FE</RequestId>
    <LDAP>
        <Account>cn=Manager,dc=test,dc=com</Account>
        <BaseDN>dc=test,dc=com</BaseDN>
        <EmailMapping>emailAttr</EmailMapping>
        <Filter>(&amp;(objectClass=top))</Filter>
        <IsSSL>true</IsSSL>
        <LoginNameMapping>userNameAttr</LoginNameMapping>
        <MobileMapping>mobileAttr</MobileMapping>
        <NameMapping>nameAttr</NameMapping>
        <HasPassword>true</HasPassword>
        <Port>389</Port>
        <Server>192.168.XX.XX</Server>
        <StandbyServer>192.168.XX.XX</StandbyServer>
    </LDAP>
</GetInstanceLDAPAuthServerResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "1C60E741-102D-5E8F-9710-B06D3F0183FE",
  "LDAP" : {
    "Account" : "cn=Manager,dc=test,dc=com",
    "BaseDN" : "dc=test,dc=com",
    "EmailMapping" : "emailAttr",
    "Filter" : "(&(objectClass=top))",
    "IsSSL" : true,
    "LoginNameMapping" : "userNameAttr",
    "MobileMapping" : "mobileAttr",
    "NameMapping" : "nameAttr",
    "HasPassword" : "true",
    "Port" : 389,
    "Server" : "192.168.XX.XX",
    "StandbyServer" : "192.168.XX.XX"
  }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParameter The argument is invalid. The error message returned because one or more parameters are invalid.
500 InternalError An unknown error occurred. The error message returned because an unknown error occurred.

For a list of error codes, visit the API Error Center.