GetLifecyclePolicies
Gets summary information about all or the specified data lifecycle policies.
To get complete information about a policy, use GetLifecyclePolicy.
Request Syntax
GET /policies?defaultPolicyType=DefaultPolicyType
&policyIds=PolicyIds
&resourceTypes=ResourceTypes
&state=State
&tagsToAdd=TagsToAdd
&targetTags=TargetTags
HTTP/1.1
URI Request Parameters
The request uses the following URI parameters.
- DefaultPolicyType
-
[Default policies only] Specifies the type of default policy to get. Specify one of the following:
-
VOLUME
- To get only the default policy for EBS snapshots -
INSTANCE
- To get only the default policy for EBS-backed AMIs -
ALL
- To get all default policies
Valid Values:
VOLUME | INSTANCE | ALL
-
- PolicyIds
-
The identifiers of the data lifecycle policies.
Length Constraints: Minimum length of 0. Maximum length of 64.
Pattern:
policy-[a-f0-9]+
- ResourceTypes
-
The resource type.
Array Members: Fixed number of 1 item.
Valid Values:
VOLUME | INSTANCE
- State
-
The activation state.
Valid Values:
ENABLED | DISABLED | ERROR
- TagsToAdd
-
The tags to add to objects created by the policy.
Tags are strings in the format
key=value
.These user-defined tags are added in addition to the AWS-added lifecycle tags.
Array Members: Minimum number of 0 items. Maximum number of 50 items.
Length Constraints: Minimum length of 0. Maximum length of 256.
Pattern:
[\p{all}]*
- TargetTags
-
The target tag for a policy.
Tags are strings in the format
key=value
.Array Members: Minimum number of 1 item. Maximum number of 50 items.
Length Constraints: Minimum length of 0. Maximum length of 256.
Pattern:
[\p{all}]*
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"Policies": [
{
"DefaultPolicy": boolean,
"Description": "string",
"PolicyId": "string",
"PolicyType": "string",
"State": "string",
"Tags": {
"string" : "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.
- Policies
-
Summary information about the lifecycle policies.
Type: Array of LifecyclePolicySummary objects
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerException
-
The service failed in an unexpected way.
HTTP Status Code: 500
- InvalidRequestException
-
Bad request. The request is missing required parameters or has invalid parameters.
HTTP Status Code: 400
- LimitExceededException
-
The request failed because a limit was exceeded.
HTTP Status Code: 429
- ResourceNotFoundException
-
A requested resource was not found.
HTTP Status Code: 404
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: