All Products
Search
Document Center

Server Load Balancer:GetListenerAttribute

Last Updated:Mar 13, 2024

Queries the details of a Network Load Balancer (NLB) listener.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
nlb:GetListenerAttributeRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ListenerIdstringYes

The ID of the listener.

lsn-bp1bpn0kn908w4nbw****
DryRunbooleanNo

Specifies whether only to precheck the request. Valid values:

  • true: checks the request but does not query the listener details. The system prechecks the required parameters, request syntax, and limits. If the request fails the precheck, an error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the precheck, an HTTP 2xx status code is returned and the operation is performed.
false
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among all requests. ClientToken can contain only ASCII characters.

Note If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId of each API request may be different.
123e4567-e89b-12d3-a456-426655440000
RegionIdstringNo

The ID of the region where the Network Load Balancer (NLB) instance is deployed.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

Queries the attributes of a listener.

RequestIdstring

The ID of the request.

CEF72CEB-54B6-4AE8-B225-F876FF7BA984
RegionIdstring

The ID of the region where the NLB instance is deployed.

cn-hangzhou
LoadBalancerIdstring

The ID of the NLB instance.

nlb-83ckzc8d4xlp8o****
ListenerIdstring

The ID of the listener.

lsn-ga6sjjcll6ou34l1et****
ListenerProtocolstring

The listening protocol. Valid values: TCP, UDP, and TCPSSL.

TCPSSL
ListenerPortinteger

The listening port. Valid values: 0 to 65535. A value of 0 specifies all ports. If you set the value to 0, you must also set the StartPort and EndPort parameters.

233
StartPortstring

The first port in the listening port range. Valid values: 0 to 65535.

233
EndPortstring

The last port in the listening port range. Valid values: 0 to 65535. The number of the last port must be smaller than that of the first port.

455
ListenerDescriptionstring

The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

tcpssl_443
ServerGroupIdstring

The ID of the server group.

sgp-ppdpc14gdm3x4o****
IdleTimeoutinteger

The timeout period of an idle connection. Unit: seconds. Valid values: 1 to 900.

900
SecurityPolicyIdstring

The ID of the security policy. System security policies and custom security policies are supported.

Valid values: tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict, and tls_cipher_policy_1_2_strict_with_1_3.

Note This parameter takes effect only for listeners that use SSL over TCP.
tls_cipher_policy_1_0
CertificateIdsarray

The server certificates. Only one server certificate is supported.

Note This parameter takes effect only for listeners that use SSL over TCP.
string

The server certificates.

12315790212_166f8204689_1714763408_70998****
CaCertificateIdsarray

The CA certificates. Only one CA certificate is supported.

Note This parameter takes effect only for listeners that use SSL over TCP.
string

The CA certificates. Only one CA certificate is supported.

Note This parameter takes effect only for listeners that use SSL over TCP.
139a00604ad-cn-east-hangzh****
CaEnabledboolean

Indicates whether mutual authentication is enabled. Valid values:

  • true: yes
  • false: no
false
AlpnEnabledboolean

Indicates whether Application-Layer Protocol Negotiation (ALPN) is enabled. Valid values:

  • true: yes
  • false: no
false
AlpnPolicystring

The ALPN policy. Valid values:

  • HTTP1Only
  • HTTP2Only
  • HTTP2Preferred
  • HTTP2Optional
HTTP1Only
ProxyProtocolEnabledboolean

Indicates whether the Proxy protocol is used to pass client IP addresses to backend servers. Valid values:

  • true: yes
  • false: no
false
ProxyProtocolV2Configobject

Indicates whether the Proxy protocol passes the VpcId, PrivateLinkEpId, and PrivateLinkEpsId parameters to backend servers.

Ppv2VpcIdEnabledboolean

Indicates whether the Proxy protocol passes the VpcId parameter to backend servers. Valid values:

  • true
  • false
false
Ppv2PrivateLinkEpIdEnabledboolean

Indicates whether the Proxy protocol passes the PrivateLinkEpId parameter to backend servers. Valid values:

  • true
  • false
false
Ppv2PrivateLinkEpsIdEnabledboolean

Indicates whether the Proxy protocol passes the PrivateLinkEpsId parameter to backend servers. Valid values:

  • true
  • false
false
SecSensorEnabledboolean

Indicates whether fine-grained monitoring is enabled. Valid values:

  • true: yes
  • false: no
false
ListenerStatusstring

The status of the listener. Valid values:

  • Provisioning: The listener is being created.
  • Running: The listener is running.
  • Configuring: The listener is being configured.
  • Stopping: The listener is being stopped.
  • Stopped: The listener is stopped.
  • Starting: The listener is being started.
  • Deleting: The listener is being deleted.
  • Deleted: The listener is deleted.
Running
Cpsinteger

The maximum number of connections that can be created per second on the NLB instance. Valid values: 0 to 1000000. 0 specifies that the number of connections is unlimited.

1000
Mssinteger

The size of the largest TCP segment. Unit: bytes. Valid values: 0 to 1500. 0 specifies that the maximum segment size remains unchanged.

Note This parameter is supported only by listeners that use SSL over TCP.
166
Tagsobject []

The tags.

TagKeystring

The tag key.

ac-cus-tag-4
TagValuestring

The tag value.

ON

Examples

Sample success responses

JSONformat

{
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
  "RegionId": "cn-hangzhou",
  "LoadBalancerId": "nlb-83ckzc8d4xlp8o****",
  "ListenerId": "lsn-ga6sjjcll6ou34l1et****",
  "ListenerProtocol": "TCPSSL",
  "ListenerPort": 233,
  "StartPort": "233",
  "EndPort": "455",
  "ListenerDescription": "tcpssl_443",
  "ServerGroupId": "sgp-ppdpc14gdm3x4o****",
  "IdleTimeout": 900,
  "SecurityPolicyId": "tls_cipher_policy_1_0",
  "CertificateIds": [
    "12315790212_166f8204689_1714763408_70998****"
  ],
  "CaCertificateIds": [
    "139a00604ad-cn-east-hangzh****"
  ],
  "CaEnabled": false,
  "AlpnEnabled": false,
  "AlpnPolicy": "HTTP1Only",
  "ProxyProtocolEnabled": false,
  "ProxyProtocolV2Config": {
    "Ppv2VpcIdEnabled": false,
    "Ppv2PrivateLinkEpIdEnabled": false,
    "Ppv2PrivateLinkEpsIdEnabled": false
  },
  "SecSensorEnabled": false,
  "ListenerStatus": "Running",
  "Cps": 1000,
  "Mss": 166,
  "Tags": [
    {
      "TagKey": "ac-cus-tag-4",
      "TagValue": "ON"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
404ResourceNotFound.loadBalancerThe specified resource of loadbalancer is not found.The specified load balancer resource was not found. Please check the input parameters.
404ResourceNotFound.listenerThe specified resource %s is not found.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-02-04The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404
    Added Error Codes: 400
2023-12-12The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404
Output ParametersThe response structure of the API has changed.
2023-11-27The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 403
    delete Error Codes: 404
Output ParametersThe response structure of the API has changed.
2023-10-10The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404
    Added Error Codes: 403
2023-09-26The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 404 change
2023-09-12The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Added Error Codes: 404
2023-06-29The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.