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 Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is DescribeRules . | Yes |
PublicKey | string | The user's public key can be obtained from Console (opens in a new tab) | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Region | string | Region. See List of Regions and Availability Zones | Yes |
ProjectId | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface. | Yes |
LoadBalancerId | string | ID of the Application Load Balancer Instance | Yes |
ListenerId | string | Listener's ID | Yes |
RuleId | string | The ID of the application load balancing forwarding rule. If RuleId is specified, only this rule will be described. | No |
Response Field
Field Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
Rules | array[Rule] | Forwarding Rule Information | Yes |
Data Model
Rule
Field Name | Type | Description Information | Required |
---|---|---|---|
RuleId | string | ID of the forwarding rule | No |
RuleConditions | array[RuleCondition] | Forwarding rule matching conditions. See RuleCondition for specific structure. | No |
RuleActions | array[RuleAction] | Forwarding action. For specific rules, see RuleAction. | No |
IsDefault | boolean | Is it the default forwarding rule? | No |
Pass | boolean | When the service node for forwarding is empty, should the rule be ignored? | No |
RuleCondition
Field Name | Type | Description Information | Required |
---|---|---|---|
Type | string | Match condition type. Limited enumeration values: Host, Path | Yes |
HostConfig | HostConfigSet | Domain-related configuration. Required when Type is Host. See HostConfigSet for specific structure. | No |
PathConfig | PathConfigSet | Configuration related to the path. Required when Type is Path. For detailed structure, see PathConfigSet. | No |
RuleAction
Field Name | Type | Description Information | Required |
---|---|---|---|
Type | string | Action Type. Limited enumeration value: Forward | Yes |
ForwardConfig | ForwardConfigSet | Forward service node related configuration. See ForwardConfigSet for specific structure. | No |
ForwardConfigSet
Field Name | Type | Description Information | Required |
---|---|---|---|
Targets | array[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 Name | Type | Description Information | Required |
---|---|---|---|
Id | string | Identification ID of the service node | Yes |
Weight | int | Weight. 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 Name | Type | Description Information | Required |
---|---|---|---|
Values | array[string] | Value. Currently only supports an array length of 1; The value must meet the conditions of the relevant matching method. | Yes |
MatchMode | string | Matching method. Limited enumeration values: Regular-Regular, Wildcard-Wildcard domain; Default value: Regular. | No |
PathConfigSet
Field Name | Type | Description Information | Required |
---|---|---|---|
Values | array[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"
}
]
}