Docs
api
Load Balance(ULB)
DescribeRules

Describe the forwarding rules of application load balancing - DescribeRules

Overview

Describe a specified forwarding rule or all forwarding rules under an application-type load balancer listener

💡 The Weight of the default rule stays in sync with the actual Weight of the target.

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is DescribeRules.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
LoadBalancerIdstringID of the Application Load Balancer InstanceYes
ListenerIdstringListener's IDYes
RuleIdstringThe ID of the application load balancing forwarding rule. If RuleId is specified, only this rule will be described.No

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
Rulesarray[Rule]Forwarding Rule InformationYes

Data Model

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.ucloud-global.com/?Action=DescribeRules
&Region=cn-zj
&ProjectId=AONmKvcb
&LoadBalancerId=cCWlIOts
&ListenerId=NmxHLcXL
&RuleId=vNcPniOK

Response Example

{
  "Action": "DescribeRulesResponse",
  "RetCode": 0,
  "Rules": [
    {
      "IsDefault": true,
      "Pass": false,
      "RuleActions": [
        {
          "ForwardConfig": {},
          "Type": "RmzLzQXc"
        }
      ],
      "RuleConditions": [
        {
          "HostConfig": {},
          "PathConfig": {},
          "Type": "cn-zj"
        }
      ],
      "RuleId": "GHOQYSjh"
    }
  ]
}