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:
  • Method Details

    • location

      public final 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.

      If the service returns an enum value that is not available in the current SDK version, location will return LocationValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from locationAsString().

      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, 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 Also:
    • locationAsString

      public final String 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, 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.

      If the service returns an enum value that is not available in the current SDK version, location will return LocationValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from locationAsString().

      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, 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 Also:
    • 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, intervalUnit will return IntervalUnitValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from intervalUnitAsString().

      Returns:
      The interval unit.
      See Also:
    • intervalUnitAsString

      public final String intervalUnitAsString()

      The interval unit.

      If the service returns an enum value that is not available in the current SDK version, intervalUnit will return IntervalUnitValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from intervalUnitAsString().

      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 the isEmpty() 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 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 the isEmpty() 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()
      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 interface ToCopyableBuilder<CreateRule.Builder,CreateRule>
      Returns:
      a builder for type T
    • builder

      public static CreateRule.Builder builder()
    • serializableBuilderClass

      public static Class<? extends CreateRule.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      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 an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • 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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.