/* * 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; /** *
* [Snapshot and AMI policies only] Specifies when the policy should create snapshots or AMIs. *
** You must specify either CronExpression, or Interval, IntervalUnit, and Times. *
** If you need to specify an ArchiveRule for the schedule, then you must specify a creation frequency of at least * 28 days. *
*
* [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create
* snapshots in the same Region as the source resource, specify CLOUD
. To create snapshots on the same
* Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
*
* If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same * Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on * the same Outpost as the source resource, or in the Region of that Outpost. *
*/ private String location; /** ** The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24. *
*/ private Integer interval; /** ** The interval unit. *
*/ private String intervalUnit; /** ** The time, in UTC, to start the operation. The supported format is hh:mm. *
** The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon * Data Lifecycle Manager selects a time within the next 24 hours. *
*/ private java.util.List* The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more * information, see Cron * expressions in the Amazon CloudWatch User Guide. *
*/ private String cronExpression; /** *
* [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create
* snapshots in the same Region as the source resource, specify CLOUD
. To create snapshots on the same
* Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
*
* If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same * Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on * the same Outpost as the source resource, or in the Region of that Outpost. *
* * @param location * [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create * snapshots in the same Region as the source resource, specifyCLOUD
. To create snapshots on
* the same Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
* * If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the * same Region as the source resource. If the policy targets resources on an Outpost, then you can create * snapshots on the same Outpost as the source resource, or in the Region of that Outpost. * @see LocationValues */ public void setLocation(String location) { this.location = location; } /** *
* [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create
* snapshots in the same Region as the source resource, specify CLOUD
. To create snapshots on the same
* Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
*
* If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same * Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on * the same Outpost as the source resource, or in the Region of that Outpost. *
* * @return [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create * snapshots in the same Region as the source resource, specifyCLOUD
. To create snapshots on
* the same Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
* * If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the * same Region as the source resource. If the policy targets resources on an Outpost, then you can create * snapshots on the same Outpost as the source resource, or in the Region of that Outpost. * @see LocationValues */ public String getLocation() { return this.location; } /** *
* [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create
* snapshots in the same Region as the source resource, specify CLOUD
. To create snapshots on the same
* Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
*
* If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same * Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on * the same Outpost as the source resource, or in the Region of that Outpost. *
* * @param location * [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create * snapshots in the same Region as the source resource, specifyCLOUD
. To create snapshots on
* the same Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
* * If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the * same Region as the source resource. If the policy targets resources on an Outpost, then you can create * snapshots on the same Outpost as the source resource, or in the Region of that Outpost. * @return Returns a reference to this object so that method calls can be chained together. * @see LocationValues */ public CreateRule withLocation(String location) { setLocation(location); return this; } /** *
* [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create
* snapshots in the same Region as the source resource, specify CLOUD
. To create snapshots on the same
* Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
*
* If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the same * Region as the source resource. If the policy targets resources on an Outpost, then you can create snapshots on * the same Outpost as the source resource, or in the Region of that Outpost. *
* * @param location * [Snapshot policies only] Specifies the destination for snapshots created by the policy. To create * snapshots in the same Region as the source resource, specifyCLOUD
. To create snapshots on
* the same Outpost as the source resource, specify OUTPOST_LOCAL
. If you omit this parameter,
* CLOUD
is used by default.
* * If the policy targets resources in an Amazon Web Services Region, then you must create snapshots in the * same Region as the source resource. If the policy targets resources on an Outpost, then you can create * snapshots on the same Outpost as the source resource, or in the Region of that Outpost. * @return Returns a reference to this object so that method calls can be chained together. * @see LocationValues */ public CreateRule withLocation(LocationValues location) { this.location = location.toString(); return this; } /** *
* The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24. *
* * @param interval * The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24. */ public void setInterval(Integer interval) { this.interval = interval; } /** ** The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24. *
* * @return The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24. */ public Integer getInterval() { return this.interval; } /** ** The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24. *
* * @param interval * The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateRule withInterval(Integer interval) { setInterval(interval); return this; } /** ** The interval unit. *
* * @param intervalUnit * The interval unit. * @see IntervalUnitValues */ public void setIntervalUnit(String intervalUnit) { this.intervalUnit = intervalUnit; } /** ** The interval unit. *
* * @return The interval unit. * @see IntervalUnitValues */ public String getIntervalUnit() { return this.intervalUnit; } /** ** The interval unit. *
* * @param intervalUnit * The interval unit. * @return Returns a reference to this object so that method calls can be chained together. * @see IntervalUnitValues */ public CreateRule withIntervalUnit(String intervalUnit) { setIntervalUnit(intervalUnit); return this; } /** ** The interval unit. *
* * @param intervalUnit * The interval unit. * @return Returns a reference to this object so that method calls can be chained together. * @see IntervalUnitValues */ public CreateRule withIntervalUnit(IntervalUnitValues intervalUnit) { this.intervalUnit = intervalUnit.toString(); return this; } /** ** The time, in UTC, to start the operation. The supported format is hh:mm. *
** The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon * Data Lifecycle Manager selects a time within the next 24 hours. *
* * @return The time, in UTC, to start the operation. The supported format is hh:mm. *
* The operation occurs within a one-hour window following the specified time. If you do not specify a time,
* Amazon Data Lifecycle Manager selects a time within the next 24 hours.
*/
public java.util.List
* The time, in UTC, to start the operation. The supported format is hh:mm.
*
* The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon
* Data Lifecycle Manager selects a time within the next 24 hours.
*
* The operation occurs within a one-hour window following the specified time. If you do not specify a time,
* Amazon Data Lifecycle Manager selects a time within the next 24 hours.
*/
public void setTimes(java.util.Collection
* The time, in UTC, to start the operation. The supported format is hh:mm.
*
* The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon
* Data Lifecycle Manager selects a time within the next 24 hours.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTimes(java.util.Collection)} or {@link #withTimes(java.util.Collection)} if you want to override the
* existing values.
*
* The operation occurs within a one-hour window following the specified time. If you do not specify a time,
* Amazon Data Lifecycle Manager selects a time within the next 24 hours.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRule withTimes(String... times) {
if (this.times == null) {
setTimes(new java.util.ArrayList
* The time, in UTC, to start the operation. The supported format is hh:mm.
*
* The operation occurs within a one-hour window following the specified time. If you do not specify a time, Amazon
* Data Lifecycle Manager selects a time within the next 24 hours.
*
* The operation occurs within a one-hour window following the specified time. If you do not specify a time,
* Amazon Data Lifecycle Manager selects a time within the next 24 hours.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateRule withTimes(java.util.Collection
* The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more
* information, see Cron
* expressions in the Amazon CloudWatch User Guide.
*
* The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more
* information, see Cron
* expressions in the Amazon CloudWatch User Guide.
*
* The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more
* information, see Cron
* expressions in the Amazon CloudWatch User Guide.
*