create_lifecycle_policy
¶
create_lifecycle_policy(
type: LifecyclePolicyType,
name: PolicyName,
policy: PolicyDocument,
*,
config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
description: Optional[PolicyDescription] = None,
client_token: Optional[ClientToken] = None,
) -> CreateLifecyclePolicyResponse
Creates a lifecyle policy to be applied to OpenSearch Serverless indexes. Lifecycle policies define the number of days or hours to retain the data on an OpenSearch Serverless index. For more information, see Creating data lifecycle policies.
Parameters:
-
type(LifecyclePolicyType) –The type of lifecycle policy.
-
name(PolicyName) –The name of the lifecycle policy.
-
description(Optional[PolicyDescription], default:None) –A description of the lifecycle policy.
-
policy(PolicyDocument) –The JSON policy document to use as the content for the lifecycle policy.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier to ensure idempotency of the request.
Raises:
-
ConflictException–When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.
-
InternalServerException–Thrown when an error internal to the service occurs while processing a request.
-
ServiceQuotaExceededException–Thrown when you attempt to create more resources than the service allows based on service quotas.
-
ValidationException–Thrown when the HTTP request contains invalid input or is missing required input.
-
UnknownServiceError–The service returned an error code this client does not model.