DescribeRules
Describes the specified rules or the rules for the specified listener. You must specify either a listener or one or more rules.
Request Syntax
{
"ListenerArn": "string
",
"Marker": "string
",
"PageSize": number
,
"RuleArns": [ "string
" ]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ListenerArn
-
The Amazon Resource Name (ARN) of the listener.
Type: String
Required: No
- Marker
-
The marker for the next set of results. (You received this marker from a previous call.)
Type: String
Required: No
- PageSize
-
The maximum number of results to return with this call.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 400.
Required: No
- RuleArns
-
The Amazon Resource Names (ARN) of the rules.
Type: Array of strings
Required: No
Response Syntax
{
"NextMarker": "string",
"Rules": [
{
"Actions": [
{
"AuthenticateCognitoConfig": {
"AuthenticationRequestExtraParams": {
"string" : "string"
},
"OnUnauthenticatedRequest": "string",
"Scope": "string",
"SessionCookieName": "string",
"SessionTimeout": number,
"UserPoolArn": "string",
"UserPoolClientId": "string",
"UserPoolDomain": "string"
},
"AuthenticateOidcConfig": {
"AuthenticationRequestExtraParams": {
"string" : "string"
},
"AuthorizationEndpoint": "string",
"ClientId": "string",
"ClientSecret": "string",
"Issuer": "string",
"OnUnauthenticatedRequest": "string",
"Scope": "string",
"SessionCookieName": "string",
"SessionTimeout": number,
"TokenEndpoint": "string",
"UseExistingClientSecret": boolean,
"UserInfoEndpoint": "string"
},
"FixedResponseConfig": {
"ContentType": "string",
"MessageBody": "string",
"StatusCode": "string"
},
"ForwardConfig": {
"TargetGroups": [
{
"TargetGroupArn": "string",
"Weight": number
}
],
"TargetGroupStickinessConfig": {
"DurationSeconds": number,
"Enabled": boolean
}
},
"Order": number,
"RedirectConfig": {
"Host": "string",
"Path": "string",
"Port": "string",
"Protocol": "string",
"Query": "string",
"StatusCode": "string"
},
"TargetGroupArn": "string",
"Type": "string"
}
],
"Conditions": [
{
"Field": "string",
"HostHeaderConfig": {
"Values": [ "string" ]
},
"HttpHeaderConfig": {
"HttpHeaderName": "string",
"Values": [ "string" ]
},
"HttpRequestMethodConfig": {
"Values": [ "string" ]
},
"PathPatternConfig": {
"Values": [ "string" ]
},
"QueryStringConfig": {
"Values": [
{
"Key": "string",
"Value": "string"
}
]
},
"SourceIpConfig": {
"Values": [ "string" ]
},
"Values": [ "string" ]
}
],
"IsDefault": boolean,
"Priority": "string",
"RuleArn": "string"
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- NextMarker
-
If there are additional results, this is the marker for the next set of results. Otherwise, this is null.
Type: String
- Rules
-
Information about the rules.
Type: Array of Rule objects
Errors
For information about the errors that are common to all actions, see Common Errors.
- ListenerNotFoundException
-
The specified listener does not exist.
HTTP Status Code: 400
- RuleNotFoundException
-
The specified rule does not exist.
HTTP Status Code: 400
- UnsupportedProtocolException
-
The specified protocol is not supported.
HTTP Status Code: 400
Examples
Describe a rule
This example describes the specified rule.
Sample Request
https://elasticloadbalancing.amazonaws.com/?Action=DescribeRules
&RuleArns.member.1=arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee
&Version=2015-12-01
&AUTHPARAMS
Sample Response
<DescribeRulesResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<DescribeRulesResult>
<Rules>
<member>
<IsDefault>false</IsDefault>
<Conditions>
<member>
<Field>path-pattern</Field>
<Values>
<member>/img/*</member>
</Values>
</member>
</Conditions>
<Priority>10</Priority>
<Actions>
<member>
<Type>forward</Type>
<TargetGroupArn>arn:aws:elasticloadbalancing:ua-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067</TargetGroupArn>
</member>
</Actions>
<RuleArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee</RuleArn>
</member>
</Rules>
</DescribeRulesResult>
<ResponseMetadata>
<RequestId>74926cf3-f3a3-11e5-b543-9f2c3fbb9bee</RequestId>
</ResponseMetadata>
</DescribeRulesResponse>
Describe the rules for a listener
This example describes the rules for the specified listener. The output includes the default rule and any other rules that you've defined.
Sample Request
https://elasticloadbalancing.amazonaws.com/?Action=DescribeRules
&ListenerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2
&Version=2015-12-01
&AUTHPARAMS
Sample Response
<DescribeRulesResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<DescribeRulesResult>
<Rules>
<member>
<IsDefault>false</IsDefault>
<Conditions>
<member>
<Field>path-pattern</Field>
<Values>
<member>/img/*</member>
</Values>
</member>
</Conditions>
<Priority>10</Priority>
<Actions>
<member>
<Type>forward</Type>
<TargetGroupArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067</TargetGroupArn>
</member>
</Actions>
<RuleArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee</RuleArn>
</member>
<member>
<IsDefault>true</IsDefault>
<Conditions />
<Priority>default</Priority>
<Actions>
<member>
<Type>forward</Type>
<TargetGroupArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067</TargetGroupArn>
</member>
</Actions>
<RuleArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/fd906cf3d7a9d36d</RuleArn>
</member>
</Rules>
</DescribeRulesResult>
<ResponseMetadata>
<RequestId>d8581c8d-f3a3-11e5-8a24-ffe2bf8623ae</RequestId>
</ResponseMetadata>
</DescribeRulesResponse>
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: