ListRules
Lists the Recycle Bin retention rules in the Region.
Request Syntax
POST /list-rules HTTP/1.1
Content-type: application/json
{
   "ExcludeResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "LockState": "string",
   "MaxResults": number,
   "NextToken": "string",
   "ResourceTags": [ 
      { 
         "ResourceTagKey": "string",
         "ResourceTagValue": "string"
      }
   ],
   "ResourceType": "string"
}URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- ExcludeResourceTags
- 
               [Region-level retention rules only] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule. Type: Array of ResourceTag objects Array Members: Minimum number of 0 items. Maximum number of 5 items. Required: No 
- LockState
- 
               The lock state of the retention rules to list. Only retention rules with the specified lock state are returned. Type: String Valid Values: locked | pending_unlock | unlockedRequired: No 
- MaxResults
- 
               The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned NextTokenvalue.Type: Integer Valid Range: Minimum value of 1. Maximum value of 1000. Required: No 
- NextToken
- 
               The token for the next page of results. Type: String Pattern: ^[A-Za-z0-9+/=]{1,2048}$Required: No 
- ResourceTags
- 
               [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. Type: Array of ResourceTag objects Array Members: Minimum number of 0 items. Maximum number of 50 items. Required: No 
- ResourceType
- 
               The resource type retained by the retention rule. Only retention rules that retain the specified resource type are listed. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To list retention rules that retain snapshots, specify EBS_SNAPSHOT. To list retention rules that retain EBS-backed AMIs, specifyEC2_IMAGE.Type: String Valid Values: EBS_SNAPSHOT | EC2_IMAGERequired: Yes 
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
   "NextToken": "string",
   "Rules": [ 
      { 
         "Description": "string",
         "Identifier": "string",
         "LockState": "string",
         "RetentionPeriod": { 
            "RetentionPeriodUnit": "string",
            "RetentionPeriodValue": number
         },
         "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.
- NextToken
- 
               The token to use to retrieve the next page of results. This value is nullwhen there are no more results to return.Type: String Pattern: ^[A-Za-z0-9+/=]{1,2048}$
- Rules
- 
               Information about the retention rules. Type: Array of RuleSummary objects 
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerException
- 
               The service could not respond to the request due to an internal problem. HTTP Status Code: 500 
- ValidationException
- 
               One or more of the parameters in the request is not valid. - Reason
- 
                        The reason for the exception. 
 HTTP Status Code: 400 
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: