docs
api
Load Balance(ULB)
DescribeListeners

Describe Application Load Balancer Listener - DescribeListeners

Overview

Describe a specified listener or all listeners under an application type load balancing instance

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is DescribeListeners.Yes
PublicKeystringThe user's public key can be obtained from Console (opens in a new tab)Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See List of Regions and Availability ZonesYes
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.Yes
ListenerIdstringThe ID of the application load balancer listener. If ListenerId is specified, LoadBalancerId is ignored. Either ListenId or LoadBalancerId must be selected.No
LoadBalancerIdstringThe ID of the application load balancer instance. If ListenId is not specified, it describes all listeners under the specified LoadBalancerId.No
OffsetintData offset, default is 0No
LimitintData pagination value, default is 100No

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
TotalCountintTotal number of load balancer listeners that meet the conditionsNo
Listenersarray[Listener]Load Balancer Listener InformationNo

Data Model

Listener

Field NameTypeDescription InformationRequired
ListenerIdstringListener's IDNo
NamestringName of the ListenerNo
RemarkstringRemarks on the ListenerNo
ListenerPortintListener's Listening PortNo
ListenerProtocolstringMonitoring Protocol. Application-specific limited values: HTTP, HTTPS.No
Certificatesarray[Certificate](Application-specific) Default server certificate ID. Only HTTPS listening is supported. For specific interface details, see Certificate.No
SecurityPolicyIdstring(Application-specific) Security policy group ID. Only HTTPS listening supports binding; Default -> Native policyNo
IdleTimeoutintConnection idle timeout. Unit: seconds.No
SchedulerstringLoad Balancing Algorithm. Application-specific limited values: Roundrobin -> Round Robin; Source -> Source Address; WeightRoundrobin -> Weighted Round Robin; Leastconn -> Least Connections; Backup -> Master-Slave ModeNo
StickinessConfigStickinessConfigSetConfiguration related to session persistence. For detailed structure, see StickinessConfigSet.No
HealthCheckConfigHealthCheckConfigSetConfiguration related to Health Check. For specific structure, see HealthCheckConfigSet.No
CompressionEnabledboolean(Application-specific) Whether to enable data compression function. Currently, only gzip is supported to compress specific file types.No
HTTP2Enabledboolean(Application-specific) Whether to enable the HTTP/2 feature. Only HTTPS listening supports enabling.No
RedirectEnabledboolean(Application-specific) Whether to enable HTTP redirection to HTTPS. Only HTTP listening supports enabling.No
RedirectPortint(Application-specific) Redirect PortNo
Targetsarray[Target]Information of the added service node. See Target for specific structure.No
Rulesarray[Rule](Application-specific) Forwarding Rule InformationNo
StatestringListener health status. Limited enumeration values: Healthy -> Healthy, Unhealthy -> Unhealthy, PartialHealth -> Partially Healthy, None -> No node status.No

Certificate

Field NameTypeDescription InformationRequired
SSLIdstringCertificate IDNo
IsDefaultbooleanIs it the default certificate?No

StickinessConfigSet

Field NameTypeDescription InformationRequired
EnabledbooleanWhether to enable the session persistence feature. The application load balancing instance is implemented based on Cookie.No
Typestring(Application-specific) Cookie processing method. Limited enumeration values: ServerInsert -> Automatically generate KEY; UserDefined -> User-defined KEY.No
CookieNamestring(Application-specific) Custom Cookie. Effective when the StickinessType value is "UserDefined"."""
No

HealthCheckConfigSet

Field NameTypeDescription InformationRequired
EnabledbooleanWhether to enable the health check function. Temporarily does not support closing. The default value is: trueNo
TypestringHealth check method. Application type limited values: Port -> Port check; HTTP -> HTTP check; Default value: PortNo
Domainstring(Application-specific) HTTP check domain. This field is meaningful when Type is HTTP, representing the HTTP check domain.No
Pathstring(Application-specific) HTTP check path. This field is meaningful when the Type is HTTP, representing the HTTP check path.No

Target

Field NameTypeDescription InformationRequired
ResourceTypestringThe type of service node. Limited enumeration values: UHost -> Cloud Host, UNI -> Virtual Network Interface, UPM -> Physical Cloud Host, IP -> IP type; Default value: "UHost"; For non-IP types, if the resource has multiple IPs, only the main IP can be added; For non-IP types, related resource information will be displayed during the display, and only IP information will be displayed for IP types. When the related resource is deleted, the non-IP type will remove the related resource from lb, and the IP type does not guarantee this logic.No
ResourceIdstringResource ID of the service nodeNo
ResourceNamestringResource Name of Service NodeNo
VPCIdstringService node's VPC resource IDNo
SubnetIdstringSubnet resource ID of the service nodeNo
ResourceIPstringIP of the service nodeNo
PortintPort of the service nodeNo
WeightintWeight of the service node. Only effective when the weighted round-robin algorithm is used.No
EnabledbooleanIs the service node enabled?No
IsBackupbooleanIs the service node a backup node?No
IdstringThe identification ID of the service node. Used in ALB/NLB, unrelated to the resource's own ID, can be used for UpdateTargetsAttribute/RemoveTargets.No
StatestringHealth check status of the service node. Limited enumeration values: Healthy -> Healthy, Unhealthy -> UnhealthyNo

Rule

Field NameTypeDescription InformationRequired
RuleIdstringID of the forwarding ruleNo
RuleConditionsarray[RuleCondition]Forwarding rule matching conditions. See RuleCondition for specific structure.No
RuleActionsarray[RuleAction]Forwarding action. For specific rules, see RuleAction.No
IsDefaultbooleanIs it the default forwarding rule?No
PassbooleanWhen the service node for forwarding is empty, should the rule be ignored?No

RuleCondition

Field NameTypeDescription InformationRequired
TypestringMatch condition type. Limited enumeration values: Host, PathYes
HostConfigHostConfigSetDomain-related configuration. Required when Type is Host. See HostConfigSet for specific structure.No
PathConfigPathConfigSetConfiguration related to the path. Required when Type is Path. For detailed structure, see PathConfigSet.No

RuleAction

Field NameTypeDescription InformationRequired
TypestringAction Type. Limited enumeration value: ForwardYes
ForwardConfigForwardConfigSetForward service node related configuration. See ForwardConfigSet for specific structure.No

ForwardConfigSet

Field NameTypeDescription InformationRequired
Targetsarray[ForwardTargetSet]The backend service nodes to be forwarded. It is limited to the service node pool of the listener; the array length can be 0. See ForwardTargetSet for detailed structure.Yes

ForwardTargetSet

Field NameTypeDescription InformationRequired
IdstringIdentification ID of the service nodeYes
WeightintWeight. Only valid when the load balancing algorithm of the listener is weighted round robin; Value range [1-100], default value is 1.No

HostConfigSet

Field NameTypeDescription InformationRequired
Valuesarray[string]Value. Currently only supports an array length of 1; The value must meet the conditions of the relevant matching method.Yes
MatchModestringMatching method. Limited enumeration values: Regular-Regular, Wildcard-Wildcard domain; Default value: Regular.No

PathConfigSet

Field NameTypeDescription InformationRequired
Valuesarray[string]Value. Currently only supports an array length of 1; The value must meet the conditions of the relevant matching method.Yes

Example

Request Example

https://api.surfercloud.com/?Action=DescribeListeners
&Region=cn-bj2
&ProjectId=org-XXXXX
&ListenerId=als-XXXXX
&LoadBalancerId=alb-XXXXX
&Offset=0
&Limit=10

Response Example

{
  "Action": "DescribeListenersResponse",
  "Listeners": [
    {
      "Certificates": [
        {
          "IsDefault": true,
          "SSLId": "ssl-XXXXXX"
        }
      ],
      "CompressionEnabled": true,
      "HTTP2Enabled": false,
      "HealthCheckConfig": [
        {
          "Enabled": false
        }
      ],
      "IdleTimeout": 60,
      "ListenPort": 80,
      "ListenProtocol": "HTTP",
      "ListenerId": "als-XXXXXX",
      "Name": "als",
      "RedirectEnabled": false,
      "RedirectPort": 7,
      "Remark": "test_als",
      "Rules": [
        {
          "IsDefault": true,
          "Pass": true,
          "RuleActions": [
            {
              "ForwardConfig": {
                "Targets": [
                  {
                    "Id": "ars-XXXXX",
                    "Weight": 1
                  }
                ]
              },
              "Type": "Forward"
            }
          ],
          "RuleConditions": [
            {
              "PathConfig": {
                "Values": [
                  "/"
                ]
              },
              "Type": "Path"
            }
          ],
          "RuleId": "rule-XXXXXX"
        },
        {
          "IsDefault": false,
          "Pass": true,
          "RuleActions": [
            {
              "ForwardConfig": {
                "Targets": [
                  {
                    "Id": "ars-XXXXX",
                    "Weight": 1
                  }
                ]
              },
              "Type": "Forward"
            }
          ],
          "RuleConditions": [
            {
              "PathConfig": {
                "Values": [
                  "/abc"
                ]
              },
              "Type": "Path"
            },
            {
              "HostConfig": {
                "MatchMode": "Regular",
                "Values": [
                  "www.*.com"
                ]
              },
              "Type": "Host"
            }
          ],
          "RuleId": "rule-XXXXXX"
        }
      ],
      "Scheduler": "Roundrobin",
      "SecurityPolicyId": "security-tls12s",
      "StickinessConfig": [
        {
          "CookieName": "test",
          "Enabled": true,
          "Type": "UserDefined"
        }
      ],
      "Targets": [
        {
          "Enabled": true,
          "Id": "ars-XXXXX",
          "IsBackup": false,
          "Port": 80,
          "ResourceIP": "X.X.X.X",
          "ResourceId": "uhost-XXXXXX",
          "ResourceName": "UHost1",
          "ResourceType": "UHost",
          "State": "Unhealthy",
          "SubnetId": "subnet-XXXXX",
          "VPCId": "vnet-XXXXX",
          "Weight": 1
        }
      ]
    }
  ],
  "RetCode": 0,
  "TotalCount": 1
}
  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved
  • Contact our sales to help your business.
  • Contact our sales to help your business.