Class CreateRule
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<CreateRule.Builder,
CreateRule>
[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.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CreateRule.Builder
builder()
final String
The schedule, as a Cron expression.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the Scripts property.final boolean
hasTimes()
For responses, this returns true if the service returned a value for the Times property.final Integer
interval()
The interval between snapshots.final IntervalUnitValues
The interval unit.final String
The interval unit.final LocationValues
location()
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.final String
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.scripts()
[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances.static Class
<? extends CreateRule.Builder> times()
The time, in UTC, to start the operation.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
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, specifyOUTPOST_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.
If the service returns an enum value that is not available in the current SDK version,
location
will returnLocationValues.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromlocationAsString()
.- Returns:
- [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, specifyOUTPOST_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 Also:
-
locationAsString
[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, specifyOUTPOST_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.
If the service returns an enum value that is not available in the current SDK version,
location
will returnLocationValues.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromlocationAsString()
.- Returns:
- [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, specifyOUTPOST_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 Also:
-
interval
The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.
- Returns:
- The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8, 12, and 24.
-
intervalUnit
The interval unit.
If the service returns an enum value that is not available in the current SDK version,
intervalUnit
will returnIntervalUnitValues.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromintervalUnitAsString()
.- Returns:
- The interval unit.
- See Also:
-
intervalUnitAsString
The interval unit.
If the service returns an enum value that is not available in the current SDK version,
intervalUnit
will returnIntervalUnitValues.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromintervalUnitAsString()
.- Returns:
- The interval unit.
- See Also:
-
hasTimes
public final boolean hasTimes()For responses, this returns true if the service returned a value for the Times property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
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.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTimes()
method.- Returns:
- 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.
-
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.
- Returns:
- 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.
-
hasScripts
public final boolean hasScripts()For responses, this returns true if the service returned a value for the Scripts property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
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.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasScripts()
method.- Returns:
- [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.
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<CreateRule.Builder,
CreateRule> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
Description copied from interface:SdkPojo
Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
-
sdkFields
-