Amazon Recycle Bin 2021-06-15
- Client: Aws\RecycleBin\RecycleBinClient
- Service ID: rbin
- Version: 2021-06-15
This page describes the parameters and results for the operations of the Amazon Recycle Bin (2021-06-15), and shows how to use the Aws\RecycleBin\RecycleBinClient object to call the described operations. This documentation is specific to the 2021-06-15 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- CreateRule ( array $params = [] )
Creates a Recycle Bin retention rule.
- DeleteRule ( array $params = [] )
Deletes a Recycle Bin retention rule.
- GetRule ( array $params = [] )
Gets information about a Recycle Bin retention rule.
- ListRules ( array $params = [] )
Lists the Recycle Bin retention rules in the Region.
- ListTagsForResource ( array $params = [] )
Lists the tags assigned to a retention rule.
- TagResource ( array $params = [] )
Assigns tags to the specified retention rule.
- UntagResource ( array $params = [] )
Unassigns a tag from a retention rule.
- UpdateRule ( array $params = [] )
Updates an existing Recycle Bin retention rule.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
CreateRule
$result = $client->createRule
([/* ... */]); $promise = $client->createRuleAsync
([/* ... */]);
Creates a Recycle Bin retention rule. For more information, see Create Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.
Parameter Syntax
$result = $client->createRule([ 'Description' => '<string>', 'ResourceTags' => [ [ 'ResourceTagKey' => '<string>', // REQUIRED 'ResourceTagValue' => '<string>', ], // ... ], 'ResourceType' => 'EBS_SNAPSHOT|EC2_IMAGE', // REQUIRED 'RetentionPeriod' => [ // REQUIRED 'RetentionPeriodUnit' => 'DAYS', // REQUIRED 'RetentionPeriodValue' => <integer>, // REQUIRED ], 'Tags' => [ [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', // REQUIRED ], // ... ], ]);
Parameter Details
Members
- Description
-
- Type: string
The retention rule description.
- ResourceTags
-
- Type: Array of ResourceTag structures
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.
- ResourceType
-
- Required: Yes
- Type: string
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, specifyEC2_IMAGE
. - RetentionPeriod
-
- Required: Yes
- Type: RetentionPeriod structure
Information about the retention period for which the retention rule is to retain resources.
- Tags
-
- Type: Array of Tag structures
Information about the tags to assign to the retention rule.
Result Syntax
[ 'Description' => '<string>', 'Identifier' => '<string>', 'ResourceTags' => [ [ 'ResourceTagKey' => '<string>', 'ResourceTagValue' => '<string>', ], // ... ], 'ResourceType' => 'EBS_SNAPSHOT|EC2_IMAGE', 'RetentionPeriod' => [ 'RetentionPeriodUnit' => 'DAYS', 'RetentionPeriodValue' => <integer>, ], 'Status' => 'pending|available', 'Tags' => [ [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], ]
Result Details
Members
- Description
-
- Type: string
The retention rule description.
- Identifier
-
- Type: string
The unique ID of the retention rule.
- ResourceTags
-
- Type: Array of ResourceTag structures
Information about the resource tags used to identify resources that are retained by the retention rule.
- ResourceType
-
- Type: string
The resource type retained by the retention rule.
- RetentionPeriod
-
- Type: RetentionPeriod structure
Information about the retention period for which the retention rule is to retain resources.
- Status
-
- Type: string
The state of the retention rule. Only retention rules that are in the
available
state retain resources. - Tags
-
- Type: Array of Tag structures
Information about the tags assigned to the retention rule.
Errors
-
One or more of the parameters in the request is not valid.
-
ServiceQuotaExceededException:
The request would cause a service quota for the number of tags per resource to be exceeded.
-
The service could not respond to the request due to an internal problem.
DeleteRule
$result = $client->deleteRule
([/* ... */]); $promise = $client->deleteRuleAsync
([/* ... */]);
Deletes a Recycle Bin retention rule. For more information, see Delete Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.
Parameter Syntax
$result = $client->deleteRule([ 'Identifier' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[]
Result Details
Errors
-
The service could not respond to the request due to an internal problem.
-
The specified resource was not found.
-
One or more of the parameters in the request is not valid.
GetRule
$result = $client->getRule
([/* ... */]); $promise = $client->getRuleAsync
([/* ... */]);
Gets information about a Recycle Bin retention rule.
Parameter Syntax
$result = $client->getRule([ 'Identifier' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[ 'Description' => '<string>', 'Identifier' => '<string>', 'ResourceTags' => [ [ 'ResourceTagKey' => '<string>', 'ResourceTagValue' => '<string>', ], // ... ], 'ResourceType' => 'EBS_SNAPSHOT|EC2_IMAGE', 'RetentionPeriod' => [ 'RetentionPeriodUnit' => 'DAYS', 'RetentionPeriodValue' => <integer>, ], 'Status' => 'pending|available', ]
Result Details
Members
- Description
-
- Type: string
The retention rule description.
- Identifier
-
- Type: string
The unique ID of the retention rule.
- ResourceTags
-
- Type: Array of ResourceTag structures
Information about the resource tags used to identify resources that are retained by the retention rule.
- ResourceType
-
- Type: string
The resource type retained by the retention rule.
- RetentionPeriod
-
- Type: RetentionPeriod structure
Information about the retention period for which the retention rule is to retain resources.
- Status
-
- Type: string
The state of the retention rule. Only retention rules that are in the
available
state retain resources.
Errors
-
One or more of the parameters in the request is not valid.
-
The service could not respond to the request due to an internal problem.
-
The specified resource was not found.
ListRules
$result = $client->listRules
([/* ... */]); $promise = $client->listRulesAsync
([/* ... */]);
Lists the Recycle Bin retention rules in the Region.
Parameter Syntax
$result = $client->listRules([ 'MaxResults' => <integer>, 'NextToken' => '<string>', 'ResourceTags' => [ [ 'ResourceTagKey' => '<string>', // REQUIRED 'ResourceTagValue' => '<string>', ], // ... ], 'ResourceType' => 'EBS_SNAPSHOT|EC2_IMAGE', // REQUIRED ]);
Parameter Details
Members
- MaxResults
-
- Type: int
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
-
- Type: string
The token for the next page of results.
- ResourceTags
-
- Type: Array of ResourceTag structures
Information about the resource tags used to identify resources that are retained by the retention rule.
- ResourceType
-
- Required: Yes
- Type: string
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
.
Result Syntax
[ 'NextToken' => '<string>', 'Rules' => [ [ 'Description' => '<string>', 'Identifier' => '<string>', 'RetentionPeriod' => [ 'RetentionPeriodUnit' => 'DAYS', 'RetentionPeriodValue' => <integer>, ], ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: string
The token to use to retrieve the next page of results. This value is
null
when there are no more results to return. - Rules
-
- Type: Array of RuleSummary structures
Information about the retention rules.
Errors
-
One or more of the parameters in the request is not valid.
-
The service could not respond to the request due to an internal problem.
ListTagsForResource
$result = $client->listTagsForResource
([/* ... */]); $promise = $client->listTagsForResourceAsync
([/* ... */]);
Lists the tags assigned to a retention rule.
Parameter Syntax
$result = $client->listTagsForResource([ 'ResourceArn' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Tags' => [ [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], ]
Result Details
Members
- Tags
-
- Type: Array of Tag structures
Information about the tags assigned to the retention rule.
Errors
-
One or more of the parameters in the request is not valid.
-
The service could not respond to the request due to an internal problem.
-
The specified resource was not found.
TagResource
$result = $client->tagResource
([/* ... */]); $promise = $client->tagResourceAsync
([/* ... */]);
Assigns tags to the specified retention rule.
Parameter Syntax
$result = $client->tagResource([ 'ResourceArn' => '<string>', // REQUIRED 'Tags' => [ // REQUIRED [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', // REQUIRED ], // ... ], ]);
Parameter Details
Members
- ResourceArn
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the retention rule.
- Tags
-
- Required: Yes
- Type: Array of Tag structures
Information about the tags to assign to the retention rule.
Result Syntax
[]
Result Details
Errors
-
One or more of the parameters in the request is not valid.
-
The service could not respond to the request due to an internal problem.
-
The specified resource was not found.
-
ServiceQuotaExceededException:
The request would cause a service quota for the number of tags per resource to be exceeded.
UntagResource
$result = $client->untagResource
([/* ... */]); $promise = $client->untagResourceAsync
([/* ... */]);
Unassigns a tag from a retention rule.
Parameter Syntax
$result = $client->untagResource([ 'ResourceArn' => '<string>', // REQUIRED 'TagKeys' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
One or more of the parameters in the request is not valid.
-
The service could not respond to the request due to an internal problem.
-
The specified resource was not found.
UpdateRule
$result = $client->updateRule
([/* ... */]); $promise = $client->updateRuleAsync
([/* ... */]);
Updates an existing Recycle Bin retention rule. For more information, see Update Recycle Bin retention rules in the Amazon Elastic Compute Cloud User Guide.
Parameter Syntax
$result = $client->updateRule([ 'Description' => '<string>', 'Identifier' => '<string>', // REQUIRED 'ResourceTags' => [ [ 'ResourceTagKey' => '<string>', // REQUIRED 'ResourceTagValue' => '<string>', ], // ... ], 'ResourceType' => 'EBS_SNAPSHOT|EC2_IMAGE', 'RetentionPeriod' => [ 'RetentionPeriodUnit' => 'DAYS', // REQUIRED 'RetentionPeriodValue' => <integer>, // REQUIRED ], ]);
Parameter Details
Members
- Description
-
- Type: string
The retention rule description.
- Identifier
-
- Required: Yes
- Type: string
The unique ID of the retention rule.
- ResourceTags
-
- Type: Array of ResourceTag structures
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.
- ResourceType
-
- Type: string
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, specifyEC2_IMAGE
. - RetentionPeriod
-
- Type: RetentionPeriod structure
Information about the retention period for which the retention rule is to retain resources.
Result Syntax
[ 'Description' => '<string>', 'Identifier' => '<string>', 'ResourceTags' => [ [ 'ResourceTagKey' => '<string>', 'ResourceTagValue' => '<string>', ], // ... ], 'ResourceType' => 'EBS_SNAPSHOT|EC2_IMAGE', 'RetentionPeriod' => [ 'RetentionPeriodUnit' => 'DAYS', 'RetentionPeriodValue' => <integer>, ], 'Status' => 'pending|available', ]
Result Details
Members
- Description
-
- Type: string
The retention rule description.
- Identifier
-
- Type: string
The unique ID of the retention rule.
- ResourceTags
-
- Type: Array of ResourceTag structures
Information about the resource tags used to identify resources that are retained by the retention rule.
- ResourceType
-
- Type: string
The resource type retained by the retention rule.
- RetentionPeriod
-
- Type: RetentionPeriod structure
Information about the retention period for which the retention rule is to retain resources.
- Status
-
- Type: string
The state of the retention rule. Only retention rules that are in the
available
state retain resources.
Errors
-
One or more of the parameters in the request is not valid.
-
The service could not respond to the request due to an internal problem.
-
The specified resource was not found.
Shapes
InternalServerException
Description
The service could not respond to the request due to an internal problem.
Members
ResourceNotFoundException
Description
The specified resource was not found.
Members
ResourceTag
Description
Information about the resource tags used to identify resources that are retained by the retention rule.
Members
RetentionPeriod
Description
Information about the retention period for which the retention rule is to retain resources.
Members
- RetentionPeriodUnit
-
- Required: Yes
- Type: string
The unit of time in which the retention period is measured. Currently, only
DAYS
is supported. - RetentionPeriodValue
-
- Required: Yes
- Type: int
The period value for which the retention rule is to retain resources. The period is measured using the unit specified for RetentionPeriodUnit.
RuleSummary
Description
Information about a Recycle Bin retention rule.
Members
- Description
-
- Type: string
The retention rule description.
- Identifier
-
- Type: string
The unique ID of the retention rule.
- RetentionPeriod
-
- Type: RetentionPeriod structure
Information about the retention period for which the retention rule is to retain resources.
ServiceQuotaExceededException
Description
The request would cause a service quota for the number of tags per resource to be exceeded.
Members
Tag
Description
Information about the tags to assign to the retention rule.