Class CreateRule
- java.lang.Object
-
- software.amazon.awssdk.services.dlm.model.CreateRule
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<CreateRule.Builder,CreateRule>
@Generated("software.amazon.awssdk:codegen") public final class CreateRule extends Object implements SdkPojo, Serializable, 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCreateRule.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CreateRule.Builderbuilder()StringcronExpression()The schedule, as a Cron expression.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()booleanhasScripts()For responses, this returns true if the service returned a value for the Scripts property.booleanhasTimes()For responses, this returns true if the service returned a value for the Times property.Integerinterval()The interval between snapshots.IntervalUnitValuesintervalUnit()The interval unit.StringintervalUnitAsString()The interval unit.LocationValueslocation()[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.StringlocationAsString()[Custom snapshot policies only] Specifies the destination for snapshots created by the policy.List<Script>scripts()[Custom snapshot policies that target instances only] Specifies pre and/or post scripts for a snapshot lifecycle policy that targets instances.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()static Class<? extends CreateRule.Builder>serializableBuilderClass()List<String>times()The time, in UTC, to start the operation.CreateRule.BuildertoBuilder()StringtoString()Returns a string representation of this object.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
location
public final LocationValues location()
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy. The allowed destinations depend on the location of the targeted resources.
-
If the policy targets resources in a Region, then you must create snapshots in the same Region as the source resource.
-
If the policy targets resources in a Local Zone, you can create snapshots in the same Local Zone or in its parent Region.
-
If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost or in its parent Region.
Specify one of the following values:
-
To create snapshots in the same Region as the source resource, specify
CLOUD. -
To create snapshots in the same Local Zone as the source resource, specify
LOCAL_ZONE. -
To create snapshots on the same Outpost as the source resource, specify
OUTPOST_LOCAL.
Default:
CLOUDIf the service returns an enum value that is not available in the current SDK version,
locationwill 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. The
allowed destinations depend on the location of the targeted resources.
-
If the policy targets resources in a Region, then you must create snapshots in the same Region as the source resource.
-
If the policy targets resources in a Local Zone, you can create snapshots in the same Local Zone or in its parent Region.
-
If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost or in its parent Region.
Specify one of the following values:
-
To create snapshots in the same Region as the source resource, specify
CLOUD. -
To create snapshots in the same Local Zone as the source resource, specify
LOCAL_ZONE. -
To create snapshots on the same Outpost as the source resource, specify
OUTPOST_LOCAL.
Default:
CLOUD -
- See Also:
LocationValues
-
-
locationAsString
public final String locationAsString()
[Custom snapshot policies only] Specifies the destination for snapshots created by the policy. The allowed destinations depend on the location of the targeted resources.
-
If the policy targets resources in a Region, then you must create snapshots in the same Region as the source resource.
-
If the policy targets resources in a Local Zone, you can create snapshots in the same Local Zone or in its parent Region.
-
If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost or in its parent Region.
Specify one of the following values:
-
To create snapshots in the same Region as the source resource, specify
CLOUD. -
To create snapshots in the same Local Zone as the source resource, specify
LOCAL_ZONE. -
To create snapshots on the same Outpost as the source resource, specify
OUTPOST_LOCAL.
Default:
CLOUDIf the service returns an enum value that is not available in the current SDK version,
locationwill 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. The
allowed destinations depend on the location of the targeted resources.
-
If the policy targets resources in a Region, then you must create snapshots in the same Region as the source resource.
-
If the policy targets resources in a Local Zone, you can create snapshots in the same Local Zone or in its parent Region.
-
If the policy targets resources on an Outpost, then you can create snapshots on the same Outpost or in its parent Region.
Specify one of the following values:
-
To create snapshots in the same Region as the source resource, specify
CLOUD. -
To create snapshots in the same Local Zone as the source resource, specify
LOCAL_ZONE. -
To create snapshots on the same Outpost as the source resource, specify
OUTPOST_LOCAL.
Default:
CLOUD -
- See Also:
LocationValues
-
-
interval
public final Integer 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
public final IntervalUnitValues intervalUnit()
The interval unit.
If the service returns an enum value that is not available in the current SDK version,
intervalUnitwill returnIntervalUnitValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromintervalUnitAsString().- Returns:
- The interval unit.
- See Also:
IntervalUnitValues
-
intervalUnitAsString
public final String intervalUnitAsString()
The interval unit.
If the service returns an enum value that is not available in the current SDK version,
intervalUnitwill returnIntervalUnitValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromintervalUnitAsString().- Returns:
- The interval unit.
- See Also:
IntervalUnitValues
-
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
public final List<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.
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
public final String cronExpression()
The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more information, see the Cron expressions reference in the Amazon EventBridge User Guide.
- Returns:
- The schedule, as a Cron expression. The schedule interval must be between 1 hour and 1 year. For more information, see the Cron expressions reference in the Amazon EventBridge 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
public final List<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.
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
public CreateRule.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<CreateRule.Builder,CreateRule>
-
builder
public static CreateRule.Builder builder()
-
serializableBuilderClass
public static Class<? extends CreateRule.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String 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.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-