@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class CreateRule extends Object implements Serializable, Cloneable, StructuredPojo
[Custom 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.
Constructor and Description |
---|
CreateRule() |
Modifier and Type | Method and Description |
---|---|
CreateRule |
clone() |
boolean |
equals(Object obj) |
String |
getCronExpression()
The schedule, as a Cron expression.
|
Integer |
getInterval()
The interval between snapshots.
|
String |
getIntervalUnit()
The interval unit.
|
String |
getLocation()
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.
|
List<Script> |
getScripts()
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot
lifecycle policy that targets instances.
|
List<String> |
getTimes()
The time, in UTC, to start the operation.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setCronExpression(String cronExpression)
The schedule, as a Cron expression.
|
void |
setInterval(Integer interval)
The interval between snapshots.
|
void |
setIntervalUnit(String intervalUnit)
The interval unit.
|
void |
setLocation(String location)
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.
|
void |
setScripts(Collection<Script> scripts)
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot
lifecycle policy that targets instances.
|
void |
setTimes(Collection<String> times)
The time, in UTC, to start the operation.
|
String |
toString()
Returns a string representation of this object.
|
CreateRule |
withCronExpression(String cronExpression)
The schedule, as a Cron expression.
|
CreateRule |
withInterval(Integer interval)
The interval between snapshots.
|
CreateRule |
withIntervalUnit(IntervalUnitValues intervalUnit)
The interval unit.
|
CreateRule |
withIntervalUnit(String intervalUnit)
The interval unit.
|
CreateRule |
withLocation(LocationValues location)
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.
|
CreateRule |
withLocation(String location)
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.
|
CreateRule |
withScripts(Collection<Script> scripts)
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot
lifecycle policy that targets instances.
|
CreateRule |
withScripts(Script... scripts)
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot
lifecycle policy that targets instances.
|
CreateRule |
withTimes(Collection<String> times)
The time, in UTC, to start the operation.
|
CreateRule |
withTimes(String... times)
The time, in UTC, to start the operation.
|
public void setLocation(String location)
[Custom 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.
location
- [Custom 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.
LocationValues
public String getLocation()
[Custom 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.
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.
LocationValues
public CreateRule withLocation(String location)
[Custom 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.
location
- [Custom 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.
LocationValues
public CreateRule withLocation(LocationValues location)
[Custom 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.
location
- [Custom 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.
LocationValues
public void setInterval(Integer interval)
The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.
interval
- The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.public Integer getInterval()
The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.
public CreateRule withInterval(Integer interval)
The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.
interval
- The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.public void setIntervalUnit(String intervalUnit)
The interval unit.
intervalUnit
- The interval unit.IntervalUnitValues
public String getIntervalUnit()
The interval unit.
IntervalUnitValues
public CreateRule withIntervalUnit(String intervalUnit)
The interval unit.
intervalUnit
- The interval unit.IntervalUnitValues
public CreateRule withIntervalUnit(IntervalUnitValues intervalUnit)
The interval unit.
intervalUnit
- The interval unit.IntervalUnitValues
public List<String> getTimes()
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(Collection<String> times)
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.
times
- 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 CreateRule withTimes(String... times)
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
setTimes(java.util.Collection)
or withTimes(java.util.Collection)
if you want to override the
existing values.
times
- 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 CreateRule withTimes(Collection<String> times)
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.
times
- 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 void setCronExpression(String cronExpression)
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.
cronExpression
- 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.public String getCronExpression()
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.
public CreateRule withCronExpression(String cronExpression)
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.
cronExpression
- 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.public List<Script> getScripts()
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances. This is useful for creating application-consistent snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager initiates snapshot creation.
For more information, see Automating application-consistent snapshots with pre and post scripts.
For more information, see Automating application-consistent snapshots with pre and post scripts.
public void setScripts(Collection<Script> scripts)
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances. This is useful for creating application-consistent snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager initiates snapshot creation.
For more information, see Automating application-consistent snapshots with pre and post scripts.
scripts
- [Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a
snapshot lifecycle policy that targets instances. This is useful for creating application-consistent
snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager
initiates snapshot creation.
For more information, see Automating application-consistent snapshots with pre and post scripts.
public CreateRule withScripts(Script... scripts)
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances. This is useful for creating application-consistent snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager initiates snapshot creation.
For more information, see Automating application-consistent snapshots with pre and post scripts.
NOTE: This method appends the values to the existing list (if any). Use
setScripts(java.util.Collection)
or withScripts(java.util.Collection)
if you want to override
the existing values.
scripts
- [Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a
snapshot lifecycle policy that targets instances. This is useful for creating application-consistent
snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager
initiates snapshot creation.
For more information, see Automating application-consistent snapshots with pre and post scripts.
public CreateRule withScripts(Collection<Script> scripts)
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances. This is useful for creating application-consistent snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager initiates snapshot creation.
For more information, see Automating application-consistent snapshots with pre and post scripts.
scripts
- [Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a
snapshot lifecycle policy that targets instances. This is useful for creating application-consistent
snapshots, or for performing specific administrative tasks before or after Amazon Data Lifecycle Manager
initiates snapshot creation.
For more information, see Automating application-consistent snapshots with pre and post scripts.
public String toString()
toString
in class Object
Object.toString()
public CreateRule clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.