/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.dlm.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* [All policy types] Specifies the configuration of a lifecycle policy. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PolicyDetails implements Serializable, Cloneable, StructuredPojo { /** *
* [All policy types] The valid target resource types and actions a policy can manage. Specify
* EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS
* snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of
* EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy that performs specific
* actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
*
* [Snapshot policies only] The target resource type for snapshot and AMI lifecycle policies. Use
* VOLUME
to create snapshots of individual volumes or use INSTANCE
to create multi-volume
* snapshots from the volumes for an instance.
*
* [Snapshot and AMI policies only] The location of the resources to backup. If the source resources are
* located in an Amazon Web Services Region, specify CLOUD
. If the source resources are located on an
* Outpost in your account, specify OUTPOST
.
*
* If you specify OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type
* with matching target tags across all of the Outposts in your account.
*
* [Snapshot and AMI policies only] The single tag that identifies targeted resources for this policy. *
*/ private java.util.List* [Snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle * policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules. *
*/ private java.util.List* [Snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies. *
** If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle Manager * console, then you must include this parameter and specify either the default values or the new values that you * require. You can't omit this parameter or set its values to null. *
** [Event-based policies only] The event that activates the event-based policy. *
*/ private EventSource eventSource; /** ** [Event-based policies only] The actions to be performed when the event-based policy is activated. You can * specify only one action per policy. *
*/ private java.util.List
* [All policy types] The valid target resource types and actions a policy can manage. Specify
* EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS
* snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of
* EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy that performs specific
* actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
*
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS
* snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle
* of EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy that performs
* specific actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
* @see PolicyTypeValues
*/
public void setPolicyType(String policyType) {
this.policyType = policyType;
}
/**
*
* [All policy types] The valid target resource types and actions a policy can manage. Specify
* EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS
* snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of
* EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy that performs specific
* actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
*
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon
* EBS snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the
* lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy
* that performs specific actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
* @see PolicyTypeValues
*/
public String getPolicyType() {
return this.policyType;
}
/**
*
* [All policy types] The valid target resource types and actions a policy can manage. Specify
* EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS
* snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of
* EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy that performs specific
* actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
*
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS
* snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle
* of EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy that performs
* specific actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PolicyTypeValues
*/
public PolicyDetails withPolicyType(String policyType) {
setPolicyType(policyType);
return this;
}
/**
*
* [All policy types] The valid target resource types and actions a policy can manage. Specify
* EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS
* snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of
* EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy that performs specific
* actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
*
EBS_SNAPSHOT_MANAGEMENT
to create a lifecycle policy that manages the lifecycle of Amazon EBS
* snapshots. Specify IMAGE_MANAGEMENT
to create a lifecycle policy that manages the lifecycle
* of EBS-backed AMIs. Specify EVENT_BASED_POLICY
to create an event-based policy that performs
* specific actions when a defined event occurs in your Amazon Web Services account.
*
* The default is EBS_SNAPSHOT_MANAGEMENT
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PolicyTypeValues
*/
public PolicyDetails withPolicyType(PolicyTypeValues policyType) {
this.policyType = policyType.toString();
return this;
}
/**
*
* [Snapshot policies only] The target resource type for snapshot and AMI lifecycle policies. Use
* VOLUME
to create snapshots of individual volumes or use INSTANCE
to create multi-volume
* snapshots from the volumes for an instance.
*
VOLUME
to create snapshots of individual volumes or use INSTANCE
to create
* multi-volume snapshots from the volumes for an instance.
* @see ResourceTypeValues
*/
public java.util.List
* [Snapshot policies only] The target resource type for snapshot and AMI lifecycle policies. Use
* VOLUME
to create snapshots of individual volumes or use INSTANCE
to create multi-volume
* snapshots from the volumes for an instance.
*
VOLUME
to create snapshots of individual volumes or use INSTANCE
to create
* multi-volume snapshots from the volumes for an instance.
* @see ResourceTypeValues
*/
public void setResourceTypes(java.util.Collection
* [Snapshot policies only] The target resource type for snapshot and AMI lifecycle policies. Use
* VOLUME
to create snapshots of individual volumes or use INSTANCE
to create multi-volume
* snapshots from the volumes for an instance.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setResourceTypes(java.util.Collection)} or {@link #withResourceTypes(java.util.Collection)} if you want * to override the existing values. *
* * @param resourceTypes * [Snapshot policies only] The target resource type for snapshot and AMI lifecycle policies. Use *VOLUME
to create snapshots of individual volumes or use INSTANCE
to create
* multi-volume snapshots from the volumes for an instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceTypeValues
*/
public PolicyDetails withResourceTypes(String... resourceTypes) {
if (this.resourceTypes == null) {
setResourceTypes(new java.util.ArrayList
* [Snapshot policies only] The target resource type for snapshot and AMI lifecycle policies. Use
* VOLUME
to create snapshots of individual volumes or use INSTANCE
to create multi-volume
* snapshots from the volumes for an instance.
*
VOLUME
to create snapshots of individual volumes or use INSTANCE
to create
* multi-volume snapshots from the volumes for an instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceTypeValues
*/
public PolicyDetails withResourceTypes(java.util.Collection
* [Snapshot policies only] The target resource type for snapshot and AMI lifecycle policies. Use
* VOLUME
to create snapshots of individual volumes or use INSTANCE
to create multi-volume
* snapshots from the volumes for an instance.
*
VOLUME
to create snapshots of individual volumes or use INSTANCE
to create
* multi-volume snapshots from the volumes for an instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceTypeValues
*/
public PolicyDetails withResourceTypes(ResourceTypeValues... resourceTypes) {
java.util.ArrayList
* [Snapshot and AMI policies only] The location of the resources to backup. If the source resources are
* located in an Amazon Web Services Region, specify CLOUD
. If the source resources are located on an
* Outpost in your account, specify OUTPOST
.
*
* If you specify OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type
* with matching target tags across all of the Outposts in your account.
*
CLOUD
. If the source resources are
* located on an Outpost in your account, specify OUTPOST
.
*
* If you specify
* [Snapshot and AMI policies only] The location of the resources to backup. If the source resources are
* located in an Amazon Web Services Region, specify
* If you specify OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the
* specified type with matching target tags across all of the Outposts in your account.
* @see ResourceLocationValues
*/
public java.util.ListCLOUD
. If the source resources are located on an
* Outpost in your account, specify OUTPOST
.
* OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type
* with matching target tags across all of the Outposts in your account.
* CLOUD
. If the source resources are
* located on an Outpost in your account, specify OUTPOST
.
* If you specify
* [Snapshot and AMI policies only] The location of the resources to backup. If the source resources are
* located in an Amazon Web Services Region, specify
* If you specify
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResourceLocations(java.util.Collection)} or {@link #withResourceLocations(java.util.Collection)} if
* you want to override the existing values.
* OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified
* type with matching target tags across all of the Outposts in your account.
* @see ResourceLocationValues
*/
public void setResourceLocations(java.util.CollectionCLOUD
. If the source resources are located on an
* Outpost in your account, specify OUTPOST
.
* OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type
* with matching target tags across all of the Outposts in your account.
* CLOUD
. If the source resources are
* located on an Outpost in your account, specify OUTPOST
.
* If you specify
* [Snapshot and AMI policies only] The location of the resources to backup. If the source resources are
* located in an Amazon Web Services Region, specify
* If you specify OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified
* type with matching target tags across all of the Outposts in your account.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceLocationValues
*/
public PolicyDetails withResourceLocations(String... resourceLocations) {
if (this.resourceLocations == null) {
setResourceLocations(new java.util.ArrayListCLOUD
. If the source resources are located on an
* Outpost in your account, specify OUTPOST
.
* OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type
* with matching target tags across all of the Outposts in your account.
* CLOUD
. If the source resources are
* located on an Outpost in your account, specify OUTPOST
.
* If you specify
* [Snapshot and AMI policies only] The location of the resources to backup. If the source resources are
* located in an Amazon Web Services Region, specify
* If you specify OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified
* type with matching target tags across all of the Outposts in your account.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceLocationValues
*/
public PolicyDetails withResourceLocations(java.util.CollectionCLOUD
. If the source resources are located on an
* Outpost in your account, specify OUTPOST
.
* OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified type
* with matching target tags across all of the Outposts in your account.
* CLOUD
. If the source resources are
* located on an Outpost in your account, specify OUTPOST
.
* If you specify
* [Snapshot and AMI policies only] The single tag that identifies targeted resources for this policy.
*
* [Snapshot and AMI policies only] The single tag that identifies targeted resources for this policy.
*
* [Snapshot and AMI policies only] The single tag that identifies targeted resources for this policy.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTargetTags(java.util.Collection)} or {@link #withTargetTags(java.util.Collection)} if you want to
* override the existing values.
*
* [Snapshot and AMI policies only] The single tag that identifies targeted resources for this policy.
*
* [Snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle
* policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.
*
* [Snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle
* policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.
*
* [Snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle
* policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSchedules(java.util.Collection)} or {@link #withSchedules(java.util.Collection)} if you want to
* override the existing values.
*
* [Snapshot and AMI policies only] The schedules of policy-defined actions for snapshot and AMI lifecycle
* policies. A policy can have up to four schedules—one mandatory schedule and up to three optional schedules.
*
* [Snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies.
*
* If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle Manager
* console, then you must include this parameter and specify either the default values or the new values that you
* require. You can't omit this parameter or set its values to null.
* OUTPOST
, Amazon Data Lifecycle Manager backs up all resources of the specified
* type with matching target tags across all of the Outposts in your account.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceLocationValues
*/
public PolicyDetails withResourceLocations(ResourceLocationValues... resourceLocations) {
java.util.ArrayList
* If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the default values or the new * values that you require. You can't omit this parameter or set its values to null. *
*/ public void setParameters(Parameters parameters) { this.parameters = parameters; } /** ** [Snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies. *
** If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle Manager * console, then you must include this parameter and specify either the default values or the new values that you * require. You can't omit this parameter or set its values to null. *
** If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the default values or the new * values that you require. You can't omit this parameter or set its values to null. *
*/ public Parameters getParameters() { return this.parameters; } /** ** [Snapshot and AMI policies only] A set of optional parameters for snapshot and AMI lifecycle policies. *
** If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle Manager * console, then you must include this parameter and specify either the default values or the new values that you * require. You can't omit this parameter or set its values to null. *
** If you are modifying a policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the default values or the new * values that you require. You can't omit this parameter or set its values to null. *
* @return Returns a reference to this object so that method calls can be chained together. */ public PolicyDetails withParameters(Parameters parameters) { setParameters(parameters); return this; } /** ** [Event-based policies only] The event that activates the event-based policy. *
* * @param eventSource * [Event-based policies only] The event that activates the event-based policy. */ public void setEventSource(EventSource eventSource) { this.eventSource = eventSource; } /** ** [Event-based policies only] The event that activates the event-based policy. *
* * @return [Event-based policies only] The event that activates the event-based policy. */ public EventSource getEventSource() { return this.eventSource; } /** ** [Event-based policies only] The event that activates the event-based policy. *
* * @param eventSource * [Event-based policies only] The event that activates the event-based policy. * @return Returns a reference to this object so that method calls can be chained together. */ public PolicyDetails withEventSource(EventSource eventSource) { setEventSource(eventSource); return this; } /** ** [Event-based policies only] The actions to be performed when the event-based policy is activated. You can * specify only one action per policy. *
* * @return [Event-based policies only] The actions to be performed when the event-based policy is activated. * You can specify only one action per policy. */ public java.util.List* [Event-based policies only] The actions to be performed when the event-based policy is activated. You can * specify only one action per policy. *
* * @param actions * [Event-based policies only] The actions to be performed when the event-based policy is activated. * You can specify only one action per policy. */ public void setActions(java.util.Collection* [Event-based policies only] The actions to be performed when the event-based policy is activated. You can * specify only one action per policy. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setActions(java.util.Collection)} or {@link #withActions(java.util.Collection)} if you want to override * the existing values. *
* * @param actions * [Event-based policies only] The actions to be performed when the event-based policy is activated. * You can specify only one action per policy. * @return Returns a reference to this object so that method calls can be chained together. */ public PolicyDetails withActions(Action... actions) { if (this.actions == null) { setActions(new java.util.ArrayList* [Event-based policies only] The actions to be performed when the event-based policy is activated. You can * specify only one action per policy. *
* * @param actions * [Event-based policies only] The actions to be performed when the event-based policy is activated. * You can specify only one action per policy. * @return Returns a reference to this object so that method calls can be chained together. */ public PolicyDetails withActions(java.util.Collection