RecycleBin.Client.
list_rules
(**kwargs)¶Lists the Recycle Bin retention rules in the Region.
See also: AWS API Documentation
Request Syntax
response = client.list_rules(
MaxResults=123,
NextToken='string',
ResourceType='EBS_SNAPSHOT'|'EC2_IMAGE',
ResourceTags=[
{
'ResourceTagKey': 'string',
'ResourceTagValue': 'string'
},
],
LockState='locked'|'pending_unlock'|'unlocked'
)
NextToken
value.[REQUIRED]
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, specify EC2_IMAGE
.
Information about the resource tags used to identify resources that are retained by the retention rule.
Information about the resource tags used to identify resources that are retained by the retention rule.
The tag key.
The tag value.
dict
Response Syntax
{
'Rules': [
{
'Identifier': 'string',
'Description': 'string',
'RetentionPeriod': {
'RetentionPeriodValue': 123,
'RetentionPeriodUnit': 'DAYS'
},
'LockState': 'locked'|'pending_unlock'|'unlocked'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Rules (list) --
Information about the retention rules.
(dict) --
Information about a Recycle Bin retention rule.
Identifier (string) --
The unique ID of the retention rule.
Description (string) --
The retention rule description.
RetentionPeriod (dict) --
Information about the retention period for which the retention rule is to retain resources.
RetentionPeriodValue (integer) --
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit .
RetentionPeriodUnit (string) --
The unit of time in which the retention period is measured. Currently, only DAYS
is supported.
LockState (string) --
The lock state for the retention rule.
locked
- The retention rule is locked and can't be modified or deleted.pending_unlock
- The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.unlocked
- The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.null
- The retention rule has never been locked. Once a retention rule has been locked, it can transition between the locked
and unlocked
states only; it can never transition back to null
.NextToken (string) --
The token to use to retrieve the next page of results. This value is null
when there are no more results to return.
Exceptions
RecycleBin.Client.exceptions.ValidationException
RecycleBin.Client.exceptions.InternalServerException