Queries forwarding rules.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListRules |
The operation that you want to perform. Set the value to ListRules. |
NextToken | String | No | FFmyTO70tTpLG6I3FmYAXGKPd**** |
The starting point of the current query. If you do not specify this parameter, the query starts from the beginning. |
MaxResults | Integer | No | 20 |
The maximum number of entries to return. Valid values: 1 to 100. Default value: 20. If you do not specify this parameter, the default value is used. Note This parameter is optional.
|
RuleIds | Array of String | No | rule-sada |
The IDs of the forwarding rules. You can specify at most 20 IDs in each request. |
ListenerIds | Array of String | No | lsn-i35udpz3pxsmnf**** |
The IDs of the listeners. You can specify at most 20 IDs in each request. |
LoadBalancerIds | Array of String | No | alb-x30o38azsuj0sx**** |
The IDs of the Application Load Balancer (ALB) instances. You can specify at most 20 IDs in each request. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
MaxResults | Integer | 50 |
The maximum number of entries returned. |
NextToken | String | FFmyTO70tTpLG6I3FmYAXGKPd**** |
The token that is used for the next query. Valid values:
|
RequestId | String | CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
The ID of the request. |
Rules | Array of Rule |
The list of forwarding rules. |
|
ListenerId | String | lsn-i35udpz3pxsmnf**** |
The ID of the listener to which the forwarding rule belongs. |
LoadBalancerId | String | alb-x30o38azsuj0sx**** |
The ID of the ALB instance to which the forwarding rule belongs. |
Priority | Integer | 1 |
The priority of the forwarding rule. Valid values: 1 to 10000. A lower value indicates a higher priority. Note The priority of each forwarding rule within a listener is unique.
|
RuleActions | Array of Action |
The actions of the forwarding rule. |
|
FixedResponseConfig | Object |
The configuration of the custom response. |
|
Content | String | dssacav |
The content of the custom response. The content is up to 1 KB in size, and can contain only ASCII characters. |
ContentType | String | text/plain |
The content type. Valid values: text/plain, text/css, text/html, application/javascript, and application/json. |
HttpCode | String | HTTP_2xx |
The HTTP status code in the response. Valid values: HTTP_2xx, HTTP_4xx, and HTTP_5xx. x is a digit. |
ForwardGroupConfig | Object |
The configuration of the server group. |
|
ServerGroupTuples | Array of ServerGroupTuple |
The list of server groups to which requests are forwarded. |
|
ServerGroupId | String | sg-atstuj3rtoptyui**** |
The server group to which requests are forwarded. |
Weight | Integer | 2 |
The weight of the server group. Valid values: 0 to 100. |
InsertHeaderConfig | Object |
The configuration of the header to be inserted. |
|
Key | String | key |
The key of the header. The key is 1 to 40 characters in length, and can contain lowercase
letters, digits, underscores (_), and hyphens (-). The header key specified by Note Cookie and Host are not supported.
|
Value | String | ClientSrcPort |
The value of the header to be inserted.
|
ValueType | String | SystemDefined |
The type of the header. Valid values:
|
Order | Integer | 1 |
The priority of the action. Valid values: 1 to 50000. A lower value indicates a higher priority. The actions of a forwarding rule are applied in descending order of priority. This parameter is not empty. The priority of each action within a forwarding rule is unique. |
RedirectConfig | Object |
The configuration of the redirect action. |
|
Host | String | www.example.com |
The hostname to which requests are redirected. Valid values:
|
HttpCode | String | 301 |
The redirect type. Valid values: 301, 302, 303, 307, and 308. |
Path | String | /test |
The path to which requests are redirected. Valid values:
|
Port | String | 10 |
The port to which requests are redirected. Valid values:
|
Protocol | String | HTTP |
The redirect protocol. Valid values:
Note HTTPS listeners do not support HTTPS to HTTP redirection.
|
Query | String | quert |
The query string of the URL to which requests are redirected. The query string is
1 to 128 characters in length, and can contain printable characters, excluding uppercase
letters and the following special characters: |
RewriteConfig | Object |
The configuration of the rewrite action. |
|
Host | String | www.example.com |
The hostname to which requests are forwarded. Valid values:
|
Path | String | /tsdf |
The path to which requests are forwarded. The path is 1 to 128 characters in length
and starts with a forward slash (/). The path can contain letters, digits, asterisks
(*), question marks (?), and the following special characters: |
Query | String | quedsa |
The query string of the URL to which requests are forwarded. The query string is 1
to 128 characters in length, and can contain printable characters, excluding uppercase
letters and the following special characters: |
TrafficMirrorConfig | Object |
The configuration of the action to mirror traffic. |
|
MirrorGroupConfig | Object |
The server group to which network traffic is mirrored. |
|
ServerGroupTuples | Array of ServerGroupTuple |
The list of server groups to which network traffic is mirrored. |
|
ServerGroupId | String | srg-00mkgijak0w4qgz9**** |
The ID of the server group. |
Weight | Integer | 2 |
The weight of the server group. Valid values: 0 to 100. |
TrafficLimitConfig | Object |
The configuration of the action to throttle traffic. |
|
QPS | Integer | 4 |
Queries per second (QPS). Valid values: 1 to 100000. |
Type | String | ForwardGroup |
The type of the action. Valid values:
A forwarding rule contains one last action and the actions that you want to perform before the last action:
|
RuleConditions | Array of Condition |
The match conditions of the forwarding rule. |
|
CookieConfig | Object |
The configuration of the cookie. |
|
Values | Array of Value |
The key-value pairs of cookies. |
|
Key | String | test |
The key of the cookie. The key is 1 to 100 characters in length, and can contain printable
characters such as lowercase letters, asterisks (*), and question marks (?). However,
uppercase letters, space characters, and the following special characters are not
supported: |
Value | String | test |
The value of the cookie. The value is 1 to 128 characters in length, and can contain
printable characters such as lowercase letters, asterisks (*), and question marks
(?). However, uppercase letters, space characters, and the following special characters
are not supported: |
HeaderConfig | Object |
The configuration of the header. |
|
Key | String | Port |
The key of the header. The key is 1 to 40 characters in length. It can contain lowercase letters, digits, hyphens (-), and underscores (_). Cookie and Host are not supported. |
Values | Array of String | 5006 |
The value of the header. The value is 1 to 128 characters in length, and can contain
printable characters whose ASCII values are |
HostConfig | Object |
The configuration of the host. |
|
Values | Array of String | www.example.com |
The hostname. Limits on the value:
|
MethodConfig | Object |
The configuration of the request method. |
|
Values | Array of String | PUT |
The request method. Valid values: HEAD, GET, POST, OPTIONS, PUT, PATCH, and DELETE. |
PathConfig | Object |
The configuration of the URL. |
|
Values | Array of String | /test |
The path. The path is 1 to 128 characters in length and starts with a forward slash
(/). The path can contain letters, digits, asterisks (*), question marks (?), and
the following special characters: |
QueryStringConfig | Object |
The configuration of the query string. |
|
Values | Array of Value |
The list of query strings. |
|
Key | String | test |
The key of the query string. The key is 1 to 100 characters in length, and can contain
printable characters such as lowercase letters, asterisks (*), and question marks
(?). However, uppercase letters, space characters, and the following special characters
are not supported: |
Value | String | test |
The value of the query string. The value is 1 to 128 characters in length, and can
contain printable characters such as lowercase letters, asterisks (*), and question
marks (?). However, uppercase letters, space characters, and the following special
characters are not supported: |
SourceIpConfig | Object |
The source IP address based on which user traffic is matched. |
|
Values | Array of String | 192.168.XX.XX/32 |
The IP addresses or CIDR blocks. A forwarding rule contains at most five IP addresses or CIDR blocks. |
Type | String | Host |
The type of the forwarding rule. Valid values:
|
RuleId | String | rule-bpn0kn908w4nbw**** |
The ID of the forwarding rule. |
RuleName | String | rule-instance-test |
The name of the forwarding rule. The name is 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name starts with a letter. |
RuleStatus | String | Available |
The status of the forwarding rule. Valid values:
|
TotalCount | Integer | 1000 |
The total number of entries returned. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListRules
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=20
&RuleIds=["rule-sada"]
&ListenerIds=["lsn-i35udpz3pxsmnf****"]
&LoadBalancerIds=["alb-x30o38azsuj0sx****"]
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListRulesResponse>
<MaxResults>50</MaxResults>
<NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
<Rules>
<ListenerId>lsn-i35udpz3pxsmnf****</ListenerId>
<LoadBalancerId>alb-x30o38azsuj0sx****</LoadBalancerId>
<Priority>1</Priority>
<RuleActions>
<FixedResponseConfig>
<Content>dssacav</Content>
<ContentType>text/plain</ContentType>
<HttpCode>HTTP_2xx</HttpCode>
</FixedResponseConfig>
<ForwardGroupConfig>
<ServerGroupTuples>
<ServerGroupId>sg-atstuj3rtoptyui****</ServerGroupId>
<Weight>2</Weight>
</ServerGroupTuples>
</ForwardGroupConfig>
<InsertHeaderConfig>
<Key>key</Key>
<Value>ClientSrcPort</Value>
<ValueType>SystemDefined</ValueType>
</InsertHeaderConfig>
<Order>1</Order>
<RedirectConfig>
<Host>www.example.com</Host>
<HttpCode>301</HttpCode>
<Path>/test</Path>
<Port>10</Port>
<Protocol>HTTP</Protocol>
<Query>quert</Query>
</RedirectConfig>
<RewriteConfig>
<Host>www.example.com</Host>
<Path>/tsdf</Path>
<Query>quedsa</Query>
</RewriteConfig>
<TrafficMirrorConfig>
<MirrorGroupConfig>
<ServerGroupTuples>
<ServerGroupId>srg-00mkgijak0w4qgz9****</ServerGroupId>
<Weight>2</Weight>
</ServerGroupTuples>
</MirrorGroupConfig>
</TrafficMirrorConfig>
<TrafficLimitConfig>
<QPS>4</QPS>
</TrafficLimitConfig>
<Type>ForwardGroup</Type>
</RuleActions>
<RuleConditions>
<CookieConfig>
<Values>
<Key>test</Key>
<Value>test</Value>
</Values>
</CookieConfig>
<HeaderConfig>
<Key>Port</Key>
<Values>5006</Values>
</HeaderConfig>
<HostConfig>
<Values>www.example.com</Values>
</HostConfig>
<MethodConfig>
<Values>PUT</Values>
</MethodConfig>
<PathConfig>
<Values>/test</Values>
</PathConfig>
<QueryStringConfig>
<Values>
<Key>test</Key>
<Value>test</Value>
</Values>
</QueryStringConfig>
<SourceIpConfig>
<Values>192.168.XX.XX/32</Values>
</SourceIpConfig>
<Type>Host</Type>
</RuleConditions>
<RuleId>rule-bpn0kn908w4nbw****</RuleId>
<RuleName>rule-instance-test</RuleName>
<RuleStatus>Available</RuleStatus>
</Rules>
<TotalCount>1000</TotalCount>
</ListRulesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"MaxResults" : 50,
"NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId" : "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
"Rules" : [ {
"ListenerId" : "lsn-i35udpz3pxsmnf****",
"LoadBalancerId" : "alb-x30o38azsuj0sx****",
"Priority" : 1,
"RuleActions" : [ {
"FixedResponseConfig" : {
"Content" : "dssacav",
"ContentType" : "text/plain",
"HttpCode" : "HTTP_2xx"
},
"ForwardGroupConfig" : {
"ServerGroupTuples" : [ {
"ServerGroupId" : "sg-atstuj3rtoptyui****",
"Weight" : 2
} ]
},
"InsertHeaderConfig" : {
"Key" : "key",
"Value" : "ClientSrcPort",
"ValueType" : "SystemDefined"
},
"Order" : 1,
"RedirectConfig" : {
"Host" : "www.example.com",
"HttpCode" : "301",
"Path" : "/test",
"Port" : "10",
"Protocol" : "HTTP",
"Query" : "quert"
},
"RewriteConfig" : {
"Host" : "www.example.com",
"Path" : "/tsdf",
"Query" : "quedsa"
},
"TrafficMirrorConfig" : {
"MirrorGroupConfig" : {
"ServerGroupTuples" : [ {
"ServerGroupId" : "srg-00mkgijak0w4qgz9****",
"Weight" : 2
} ]
}
},
"TrafficLimitConfig" : {
"QPS" : 4
},
"Type" : "ForwardGroup"
} ],
"RuleConditions" : [ {
"CookieConfig" : {
"Values" : [ {
"Key" : "test",
"Value" : "test"
} ]
},
"HeaderConfig" : {
"Key" : "Port",
"Values" : [ "5006" ]
},
"HostConfig" : {
"Values" : [ "www.example.com" ]
},
"MethodConfig" : {
"Values" : [ "PUT" ]
},
"PathConfig" : {
"Values" : [ "/test" ]
},
"QueryStringConfig" : {
"Values" : [ {
"Key" : "test",
"Value" : "test"
} ]
},
"SourceIpConfig" : {
"Values" : [ "192.168.XX.XX/32" ]
},
"Type" : "Host"
} ],
"RuleId" : "rule-bpn0kn908w4nbw****",
"RuleName" : "rule-instance-test",
"RuleStatus" : "Available"
} ],
"TotalCount" : 1000
}
Error codes
For a list of error codes, visit the API Error Center.