RecycleBin ********** Client ====== class RecycleBin.Client A low-level client representing Amazon Recycle Bin This is the *Recycle Bin API Reference*. This documentation provides descriptions and syntax for each of the actions and data types in Recycle Bin. Recycle Bin is a resource recovery feature that enables you to restore accidentally deleted snapshots and EBS-backed AMIs. When using Recycle Bin, if your resources are deleted, they are retained in the Recycle Bin for a time period that you specify. You can restore a resource from the Recycle Bin at any time before its retention period expires. After you restore a resource from the Recycle Bin, the resource is removed from the Recycle Bin, and you can then use it in the same way you use any other resource of that type in your account. If the retention period expires and the resource is not restored, the resource is permanently deleted from the Recycle Bin and is no longer available for recovery. For more information about Recycle Bin, see Recycle Bin in the *Amazon Elastic Compute Cloud User Guide*. import boto3 client = boto3.client('rbin') These are the available methods: * can_paginate * close * create_rule * delete_rule * get_paginator * get_rule * get_waiter * list_rules * list_tags_for_resource * lock_rule * tag_resource * unlock_rule * untag_resource * update_rule Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * ListRules RecycleBin / Paginator / ListRules ListRules ********* class RecycleBin.Paginator.ListRules paginator = client.get_paginator('list_rules') paginate(**kwargs) Creates an iterator that will paginate through responses from "RecycleBin.Client.list_rules()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( ResourceType='EBS_SNAPSHOT'|'EC2_IMAGE', ResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], LockState='locked'|'pending_unlock'|'unlocked', ExcludeResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **ResourceType** (*string*) -- **[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". * **ResourceTags** (*list*) -- [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* **[REQUIRED]** The tag key. * **ResourceTagValue** *(string) --* The tag value. * **LockState** (*string*) -- The lock state of the retention rules to list. Only retention rules with the specified lock state are returned. * **ExcludeResourceTags** (*list*) -- [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. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* **[REQUIRED]** The tag key. * **ResourceTagValue** *(string) --* The tag value. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Rules': [ { 'Identifier': 'string', 'Description': 'string', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'LockState': 'locked'|'pending_unlock'|'unlocked', 'RuleArn': '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) --* [Region-level retention rules only] 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". * **RuleArn** *(string) --* The Amazon Resource Name (ARN) of the retention rule. RecycleBin / Client / get_paginator get_paginator ************* RecycleBin.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. RecycleBin / Client / create_rule create_rule *********** RecycleBin.Client.create_rule(**kwargs) Creates a Recycle Bin retention rule. You can create two types of retention rules: * **Tag-level retention rules** - These retention rules use resource tags to identify the resources to protect. For each retention rule, you specify one or more tag key and value pairs. Resources (of the specified type) that have at least one of these tag key and value pairs are automatically retained in the Recycle Bin upon deletion. Use this type of retention rule to protect specific resources in your account based on their tags. * **Region-level retention rules** - These retention rules, by default, apply to all of the resources (of the specified type) in the Region, even if the resources are not tagged. However, you can specify exclusion tags to exclude resources that have specific tags. Use this type of retention rule to protect all resources of a specific type in a Region. For more information, see Create Recycle Bin retention rules in the *Amazon EBS User Guide*. See also: AWS API Documentation **Request Syntax** response = client.create_rule( RetentionPeriod={ 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, Description='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ], ResourceType='EBS_SNAPSHOT'|'EC2_IMAGE', ResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], LockConfiguration={ 'UnlockDelay': { 'UnlockDelayValue': 123, 'UnlockDelayUnit': 'DAYS' } }, ExcludeResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] ) Parameters: * **RetentionPeriod** (*dict*) -- **[REQUIRED]** Information about the retention period for which the retention rule is to retain resources. * **RetentionPeriodValue** *(integer) --* **[REQUIRED]** The period value for which the retention rule is to retain resources. The period is measured using the unit specified for **RetentionPeriodUnit**. * **RetentionPeriodUnit** *(string) --* **[REQUIRED]** The unit of time in which the retention period is measured. Currently, only "DAYS" is supported. * **Description** (*string*) -- The retention rule description. * **Tags** (*list*) -- Information about the tags to assign to the retention rule. * *(dict) --* Information about the tags to assign to the retention rule. * **Key** *(string) --* **[REQUIRED]** The tag key. * **Value** *(string) --* **[REQUIRED]** The tag value. * **ResourceType** (*string*) -- **[REQUIRED]** The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify "EBS_SNAPSHOT". To retain EBS-backed AMIs, specify "EC2_IMAGE". * **ResourceTags** (*list*) -- [Tag-level retention rules only] Specifies the resource tags to use to identify resources that are to be retained by a tag- level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule. You can add the same tag key and value pair to a maximum or five retention rules. To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* **[REQUIRED]** The tag key. * **ResourceTagValue** *(string) --* The tag value. * **LockConfiguration** (*dict*) -- Information about the retention rule lock configuration. * **UnlockDelay** *(dict) --* **[REQUIRED]** Information about the retention rule unlock delay. * **UnlockDelayValue** *(integer) --* **[REQUIRED]** The unlock delay period, measured in the unit specified for **UnlockDelayUnit**. * **UnlockDelayUnit** *(string) --* **[REQUIRED]** The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days. * **ExcludeResourceTags** (*list*) -- [Region-level retention rules only] Specifies the exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. Resources that have any of these tags are not retained by the retention rule upon deletion. You can't specify exclusion tags for tag-level retention rules. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* **[REQUIRED]** The tag key. * **ResourceTagValue** *(string) --* The tag value. Return type: dict Returns: **Response Syntax** { 'Identifier': 'string', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'Description': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'ResourceType': 'EBS_SNAPSHOT'|'EC2_IMAGE', 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available', 'LockConfiguration': { 'UnlockDelay': { 'UnlockDelayValue': 123, 'UnlockDelayUnit': 'DAYS' } }, 'LockState': 'locked'|'pending_unlock'|'unlocked', 'RuleArn': 'string', 'ExcludeResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] } **Response Structure** * *(dict) --* * **Identifier** *(string) --* The unique ID of the retention rule. * **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. * **Description** *(string) --* The retention rule description. * **Tags** *(list) --* Information about the tags assigned to the retention rule. * *(dict) --* Information about the tags to assign to the retention rule. * **Key** *(string) --* The tag key. * **Value** *(string) --* The tag value. * **ResourceType** *(string) --* The resource type retained by the retention rule. * **ResourceTags** *(list) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. * **Status** *(string) --* The state of the retention rule. Only retention rules that are in the "available" state retain resources. * **LockConfiguration** *(dict) --* Information about the retention rule lock configuration. * **UnlockDelay** *(dict) --* Information about the retention rule unlock delay. * **UnlockDelayValue** *(integer) --* The unlock delay period, measured in the unit specified for **UnlockDelayUnit**. * **UnlockDelayUnit** *(string) --* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days. * **LockState** *(string) --* [Region-level retention rules only] 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". * **RuleArn** *(string) --* The Amazon Resource Name (ARN) of the retention rule. * **ExcludeResourceTags** *(list) --* [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. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. **Exceptions** * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.ServiceQuotaExceededException" * "RecycleBin.Client.exceptions.InternalServerException" RecycleBin / Client / can_paginate can_paginate ************ RecycleBin.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. RecycleBin / Client / delete_rule delete_rule *********** RecycleBin.Client.delete_rule(**kwargs) Deletes a Recycle Bin retention rule. For more information, see Delete Recycle Bin retention rules in the *Amazon Elastic Compute Cloud User Guide*. See also: AWS API Documentation **Request Syntax** response = client.delete_rule( Identifier='string' ) Parameters: **Identifier** (*string*) -- **[REQUIRED]** The unique ID of the retention rule. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "RecycleBin.Client.exceptions.InternalServerException" * "RecycleBin.Client.exceptions.ResourceNotFoundException" * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.ConflictException" RecycleBin / Client / unlock_rule unlock_rule *********** RecycleBin.Client.unlock_rule(**kwargs) Unlocks a retention rule. After a retention rule is unlocked, it can be modified or deleted only after the unlock delay period expires. See also: AWS API Documentation **Request Syntax** response = client.unlock_rule( Identifier='string' ) Parameters: **Identifier** (*string*) -- **[REQUIRED]** The unique ID of the retention rule. Return type: dict Returns: **Response Syntax** { 'Identifier': 'string', 'Description': 'string', 'ResourceType': 'EBS_SNAPSHOT'|'EC2_IMAGE', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available', 'LockConfiguration': { 'UnlockDelay': { 'UnlockDelayValue': 123, 'UnlockDelayUnit': 'DAYS' } }, 'LockState': 'locked'|'pending_unlock'|'unlocked', 'LockEndTime': datetime(2015, 1, 1), 'RuleArn': 'string', 'ExcludeResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] } **Response Structure** * *(dict) --* * **Identifier** *(string) --* The unique ID of the retention rule. * **Description** *(string) --* The retention rule description. * **ResourceType** *(string) --* The resource type retained by the retention rule. * **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. * **ResourceTags** *(list) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. * **Status** *(string) --* The state of the retention rule. Only retention rules that are in the "available" state retain resources. * **LockConfiguration** *(dict) --* Information about the retention rule lock configuration. * **UnlockDelay** *(dict) --* Information about the retention rule unlock delay. * **UnlockDelayValue** *(integer) --* The unlock delay period, measured in the unit specified for **UnlockDelayUnit**. * **UnlockDelayUnit** *(string) --* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days. * **LockState** *(string) --* [Region-level retention rules only] 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". * **LockEndTime** *(datetime) --* The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period. * **RuleArn** *(string) --* The Amazon Resource Name (ARN) of the retention rule. * **ExcludeResourceTags** *(list) --* [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. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. **Exceptions** * "RecycleBin.Client.exceptions.InternalServerException" * "RecycleBin.Client.exceptions.ResourceNotFoundException" * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.ConflictException" RecycleBin / Client / list_tags_for_resource list_tags_for_resource ********************** RecycleBin.Client.list_tags_for_resource(**kwargs) Lists the tags assigned to a retention rule. See also: AWS API Documentation **Request Syntax** response = client.list_tags_for_resource( ResourceArn='string' ) Parameters: **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the retention rule. Return type: dict Returns: **Response Syntax** { 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } **Response Structure** * *(dict) --* * **Tags** *(list) --* Information about the tags assigned to the retention rule. * *(dict) --* Information about the tags to assign to the retention rule. * **Key** *(string) --* The tag key. * **Value** *(string) --* The tag value. **Exceptions** * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.InternalServerException" * "RecycleBin.Client.exceptions.ResourceNotFoundException" RecycleBin / Client / get_rule get_rule ******** RecycleBin.Client.get_rule(**kwargs) Gets information about a Recycle Bin retention rule. See also: AWS API Documentation **Request Syntax** response = client.get_rule( Identifier='string' ) Parameters: **Identifier** (*string*) -- **[REQUIRED]** The unique ID of the retention rule. Return type: dict Returns: **Response Syntax** { 'Identifier': 'string', 'Description': 'string', 'ResourceType': 'EBS_SNAPSHOT'|'EC2_IMAGE', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available', 'LockConfiguration': { 'UnlockDelay': { 'UnlockDelayValue': 123, 'UnlockDelayUnit': 'DAYS' } }, 'LockState': 'locked'|'pending_unlock'|'unlocked', 'LockEndTime': datetime(2015, 1, 1), 'RuleArn': 'string', 'ExcludeResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] } **Response Structure** * *(dict) --* * **Identifier** *(string) --* The unique ID of the retention rule. * **Description** *(string) --* The retention rule description. * **ResourceType** *(string) --* The resource type retained by the retention rule. * **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. * **ResourceTags** *(list) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. * **Status** *(string) --* The state of the retention rule. Only retention rules that are in the "available" state retain resources. * **LockConfiguration** *(dict) --* Information about the retention rule lock configuration. * **UnlockDelay** *(dict) --* Information about the retention rule unlock delay. * **UnlockDelayValue** *(integer) --* The unlock delay period, measured in the unit specified for **UnlockDelayUnit**. * **UnlockDelayUnit** *(string) --* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days. * **LockState** *(string) --* [Region-level retention rules only] 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". * **LockEndTime** *(datetime) --* The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period. * **RuleArn** *(string) --* The Amazon Resource Name (ARN) of the retention rule. * **ExcludeResourceTags** *(list) --* [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. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. **Exceptions** * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.InternalServerException" * "RecycleBin.Client.exceptions.ResourceNotFoundException" RecycleBin / Client / untag_resource untag_resource ************** RecycleBin.Client.untag_resource(**kwargs) Unassigns a tag from a retention rule. See also: AWS API Documentation **Request Syntax** response = client.untag_resource( ResourceArn='string', TagKeys=[ 'string', ] ) Parameters: * **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the retention rule. * **TagKeys** (*list*) -- **[REQUIRED]** The tag keys of the tags to unassign. All tags that have the specified tag key are unassigned. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.InternalServerException" * "RecycleBin.Client.exceptions.ResourceNotFoundException" RecycleBin / Client / get_waiter get_waiter ********** RecycleBin.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" RecycleBin / Client / update_rule update_rule *********** RecycleBin.Client.update_rule(**kwargs) Updates an existing Recycle Bin retention rule. You can update a retention rule's description, resource tags, and retention period at any time after creation. You can't update a retention rule's resource type after creation. For more information, see Update Recycle Bin retention rules in the *Amazon Elastic Compute Cloud User Guide*. See also: AWS API Documentation **Request Syntax** response = client.update_rule( Identifier='string', RetentionPeriod={ 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, Description='string', ResourceType='EBS_SNAPSHOT'|'EC2_IMAGE', ResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], ExcludeResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] ) Parameters: * **Identifier** (*string*) -- **[REQUIRED]** The unique ID of the retention rule. * **RetentionPeriod** (*dict*) -- Information about the retention period for which the retention rule is to retain resources. * **RetentionPeriodValue** *(integer) --* **[REQUIRED]** The period value for which the retention rule is to retain resources. The period is measured using the unit specified for **RetentionPeriodUnit**. * **RetentionPeriodUnit** *(string) --* **[REQUIRED]** The unit of time in which the retention period is measured. Currently, only "DAYS" is supported. * **Description** (*string*) -- The retention rule description. * **ResourceType** (*string*) -- Note: This parameter is currently not supported. You can't update a retention rule's resource type after creation. * **ResourceTags** (*list*) -- [Tag-level retention rules only] Specifies the resource tags to use to identify resources that are to be retained by a tag- level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule. You can add the same tag key and value pair to a maximum or five retention rules. To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* **[REQUIRED]** The tag key. * **ResourceTagValue** *(string) --* The tag value. * **ExcludeResourceTags** (*list*) -- [Region-level retention rules only] Specifies the exclusion tags to use to identify resources that are to be excluded, or ignored, by a Region-level retention rule. Resources that have any of these tags are not retained by the retention rule upon deletion. You can't specify exclusion tags for tag-level retention rules. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* **[REQUIRED]** The tag key. * **ResourceTagValue** *(string) --* The tag value. Return type: dict Returns: **Response Syntax** { 'Identifier': 'string', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'Description': 'string', 'ResourceType': 'EBS_SNAPSHOT'|'EC2_IMAGE', 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available', 'LockState': 'locked'|'pending_unlock'|'unlocked', 'LockEndTime': datetime(2015, 1, 1), 'RuleArn': 'string', 'ExcludeResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] } **Response Structure** * *(dict) --* * **Identifier** *(string) --* The unique ID of the retention rule. * **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. * **Description** *(string) --* The retention rule description. * **ResourceType** *(string) --* The resource type retained by the retention rule. * **ResourceTags** *(list) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. * **Status** *(string) --* The state of the retention rule. Only retention rules that are in the "available" state retain resources. * **LockState** *(string) --* [Region-level retention rules only] 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". * **LockEndTime** *(datetime) --* The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period. * **RuleArn** *(string) --* The Amazon Resource Name (ARN) of the retention rule. * **ExcludeResourceTags** *(list) --* [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. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. **Exceptions** * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.InternalServerException" * "RecycleBin.Client.exceptions.ResourceNotFoundException" * "RecycleBin.Client.exceptions.ConflictException" * "RecycleBin.Client.exceptions.ServiceQuotaExceededException" RecycleBin / Client / lock_rule lock_rule ********* RecycleBin.Client.lock_rule(**kwargs) Locks a Region-level retention rule. A locked retention rule can't be modified or deleted. Note: You can't lock tag-level retention rules, or Region-level retention rules that have exclusion tags. See also: AWS API Documentation **Request Syntax** response = client.lock_rule( Identifier='string', LockConfiguration={ 'UnlockDelay': { 'UnlockDelayValue': 123, 'UnlockDelayUnit': 'DAYS' } } ) Parameters: * **Identifier** (*string*) -- **[REQUIRED]** The unique ID of the retention rule. * **LockConfiguration** (*dict*) -- **[REQUIRED]** Information about the retention rule lock configuration. * **UnlockDelay** *(dict) --* **[REQUIRED]** Information about the retention rule unlock delay. * **UnlockDelayValue** *(integer) --* **[REQUIRED]** The unlock delay period, measured in the unit specified for **UnlockDelayUnit**. * **UnlockDelayUnit** *(string) --* **[REQUIRED]** The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days. Return type: dict Returns: **Response Syntax** { 'Identifier': 'string', 'Description': 'string', 'ResourceType': 'EBS_SNAPSHOT'|'EC2_IMAGE', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'ResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ], 'Status': 'pending'|'available', 'LockConfiguration': { 'UnlockDelay': { 'UnlockDelayValue': 123, 'UnlockDelayUnit': 'DAYS' } }, 'LockState': 'locked'|'pending_unlock'|'unlocked', 'RuleArn': 'string', 'ExcludeResourceTags': [ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] } **Response Structure** * *(dict) --* * **Identifier** *(string) --* The unique ID of the retention rule. * **Description** *(string) --* The retention rule description. * **ResourceType** *(string) --* The resource type retained by the retention rule. * **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. * **ResourceTags** *(list) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. * **Status** *(string) --* The state of the retention rule. Only retention rules that are in the "available" state retain resources. * **LockConfiguration** *(dict) --* Information about the retention rule lock configuration. * **UnlockDelay** *(dict) --* Information about the retention rule unlock delay. * **UnlockDelayValue** *(integer) --* The unlock delay period, measured in the unit specified for **UnlockDelayUnit**. * **UnlockDelayUnit** *(string) --* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days. * **LockState** *(string) --* [Region-level retention rules only] 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". * **RuleArn** *(string) --* The Amazon Resource Name (ARN) of the retention rule. * **ExcludeResourceTags** *(list) --* [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. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* The tag key. * **ResourceTagValue** *(string) --* The tag value. **Exceptions** * "RecycleBin.Client.exceptions.InternalServerException" * "RecycleBin.Client.exceptions.ResourceNotFoundException" * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.ConflictException" RecycleBin / Client / close close ***** RecycleBin.Client.close() Closes underlying endpoint connections. RecycleBin / Client / list_rules list_rules ********** 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', ExcludeResourceTags=[ { 'ResourceTagKey': 'string', 'ResourceTagValue': 'string' }, ] ) Parameters: * **MaxResults** (*integer*) -- The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned "NextToken" value. * **NextToken** (*string*) -- The token for the next page of results. * **ResourceType** (*string*) -- **[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". * **ResourceTags** (*list*) -- [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* **[REQUIRED]** The tag key. * **ResourceTagValue** *(string) --* The tag value. * **LockState** (*string*) -- The lock state of the retention rules to list. Only retention rules with the specified lock state are returned. * **ExcludeResourceTags** (*list*) -- [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. * *(dict) --* [Tag-level retention rules only] Information about the resource tags used to identify resources that are retained by the retention rule. * **ResourceTagKey** *(string) --* **[REQUIRED]** The tag key. * **ResourceTagValue** *(string) --* The tag value. Return type: dict Returns: **Response Syntax** { 'Rules': [ { 'Identifier': 'string', 'Description': 'string', 'RetentionPeriod': { 'RetentionPeriodValue': 123, 'RetentionPeriodUnit': 'DAYS' }, 'LockState': 'locked'|'pending_unlock'|'unlocked', 'RuleArn': 'string' }, ], '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) --* [Region-level retention rules only] 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". * **RuleArn** *(string) --* The Amazon Resource Name (ARN) of the retention rule. * **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" RecycleBin / Client / tag_resource tag_resource ************ RecycleBin.Client.tag_resource(**kwargs) Assigns tags to the specified retention rule. See also: AWS API Documentation **Request Syntax** response = client.tag_resource( ResourceArn='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the retention rule. * **Tags** (*list*) -- **[REQUIRED]** Information about the tags to assign to the retention rule. * *(dict) --* Information about the tags to assign to the retention rule. * **Key** *(string) --* **[REQUIRED]** The tag key. * **Value** *(string) --* **[REQUIRED]** The tag value. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "RecycleBin.Client.exceptions.ValidationException" * "RecycleBin.Client.exceptions.InternalServerException" * "RecycleBin.Client.exceptions.ResourceNotFoundException" * "RecycleBin.Client.exceptions.ServiceQuotaExceededException"