Class Script
- java.lang.Object
-
- software.amazon.awssdk.services.dlm.model.Script
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<Script.Builder,Script>
@Generated("software.amazon.awssdk:codegen") public final class Script extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Script.Builder,Script>
[Snapshot policies that target instances only] Information about pre and/or post scripts for a snapshot lifecycle policy that targets instances. For more information, see Automating application-consistent snapshots with pre and post scripts.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceScript.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Script.Builderbuilder()booleanequals(Object obj)booleanequalsBySdkFields(Object obj)BooleanexecuteOperationOnScriptFailure()Indicates whether Amazon Data Lifecycle Manager should default to crash-consistent snapshots if the pre script fails.StringexecutionHandler()The SSM document that includes the pre and/or post scripts to run.ExecutionHandlerServiceValuesexecutionHandlerService()Indicates the service used to execute the pre and/or post scripts.StringexecutionHandlerServiceAsString()Indicates the service used to execute the pre and/or post scripts.IntegerexecutionTimeout()Specifies a timeout period, in seconds, after which Amazon Data Lifecycle Manager fails the script run attempt if it has not completed.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()booleanhasStages()For responses, this returns true if the service returned a value for the Stages property.IntegermaximumRetryCount()Specifies the number of times Amazon Data Lifecycle Manager should retry scripts that fail.List<SdkField<?>>sdkFields()static Class<? extends Script.Builder>serializableBuilderClass()List<StageValues>stages()Indicate which scripts Amazon Data Lifecycle Manager should run on target instances.List<String>stagesAsStrings()Indicate which scripts Amazon Data Lifecycle Manager should run on target instances.Script.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
-
stages
public final List<StageValues> stages()
Indicate which scripts Amazon Data Lifecycle Manager should run on target instances. Pre scripts run before Amazon Data Lifecycle Manager initiates snapshot creation. Post scripts run after Amazon Data Lifecycle Manager initiates snapshot creation.
-
To run a pre script only, specify
PRE. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-scriptparameter before initiating snapshot creation. -
To run a post script only, specify
POST. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepost-scriptparameter after initiating snapshot creation. -
To run both pre and post scripts, specify both
PREandPOST. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-scriptparameter before initiating snapshot creation, and then it calls the SSM document again with thepost-scriptparameter after initiating snapshot creation.
If you are automating VSS Backups, omit this parameter.
Default: PRE and POST
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
hasStages()method.- Returns:
- Indicate which scripts Amazon Data Lifecycle Manager should run on target instances. Pre scripts run
before Amazon Data Lifecycle Manager initiates snapshot creation. Post scripts run after Amazon Data
Lifecycle Manager initiates snapshot creation.
-
To run a pre script only, specify
PRE. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-scriptparameter before initiating snapshot creation. -
To run a post script only, specify
POST. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepost-scriptparameter after initiating snapshot creation. -
To run both pre and post scripts, specify both
PREandPOST. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-scriptparameter before initiating snapshot creation, and then it calls the SSM document again with thepost-scriptparameter after initiating snapshot creation.
If you are automating VSS Backups, omit this parameter.
Default: PRE and POST
-
-
-
hasStages
public final boolean hasStages()
For responses, this returns true if the service returned a value for the Stages 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.
-
stagesAsStrings
public final List<String> stagesAsStrings()
Indicate which scripts Amazon Data Lifecycle Manager should run on target instances. Pre scripts run before Amazon Data Lifecycle Manager initiates snapshot creation. Post scripts run after Amazon Data Lifecycle Manager initiates snapshot creation.
-
To run a pre script only, specify
PRE. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-scriptparameter before initiating snapshot creation. -
To run a post script only, specify
POST. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepost-scriptparameter after initiating snapshot creation. -
To run both pre and post scripts, specify both
PREandPOST. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-scriptparameter before initiating snapshot creation, and then it calls the SSM document again with thepost-scriptparameter after initiating snapshot creation.
If you are automating VSS Backups, omit this parameter.
Default: PRE and POST
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
hasStages()method.- Returns:
- Indicate which scripts Amazon Data Lifecycle Manager should run on target instances. Pre scripts run
before Amazon Data Lifecycle Manager initiates snapshot creation. Post scripts run after Amazon Data
Lifecycle Manager initiates snapshot creation.
-
To run a pre script only, specify
PRE. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-scriptparameter before initiating snapshot creation. -
To run a post script only, specify
POST. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepost-scriptparameter after initiating snapshot creation. -
To run both pre and post scripts, specify both
PREandPOST. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-scriptparameter before initiating snapshot creation, and then it calls the SSM document again with thepost-scriptparameter after initiating snapshot creation.
If you are automating VSS Backups, omit this parameter.
Default: PRE and POST
-
-
-
executionHandlerService
public final ExecutionHandlerServiceValues executionHandlerService()
Indicates the service used to execute the pre and/or post scripts.
-
If you are using custom SSM documents, specify
AWS_SYSTEMS_MANAGER. -
If you are automating VSS Backups, omit this parameter.
Default: AWS_SYSTEMS_MANAGER
If the service returns an enum value that is not available in the current SDK version,
executionHandlerServicewill returnExecutionHandlerServiceValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromexecutionHandlerServiceAsString().- Returns:
- Indicates the service used to execute the pre and/or post scripts.
-
If you are using custom SSM documents, specify
AWS_SYSTEMS_MANAGER. -
If you are automating VSS Backups, omit this parameter.
Default: AWS_SYSTEMS_MANAGER
-
- See Also:
ExecutionHandlerServiceValues
-
-
executionHandlerServiceAsString
public final String executionHandlerServiceAsString()
Indicates the service used to execute the pre and/or post scripts.
-
If you are using custom SSM documents, specify
AWS_SYSTEMS_MANAGER. -
If you are automating VSS Backups, omit this parameter.
Default: AWS_SYSTEMS_MANAGER
If the service returns an enum value that is not available in the current SDK version,
executionHandlerServicewill returnExecutionHandlerServiceValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromexecutionHandlerServiceAsString().- Returns:
- Indicates the service used to execute the pre and/or post scripts.
-
If you are using custom SSM documents, specify
AWS_SYSTEMS_MANAGER. -
If you are automating VSS Backups, omit this parameter.
Default: AWS_SYSTEMS_MANAGER
-
- See Also:
ExecutionHandlerServiceValues
-
-
executionHandler
public final String executionHandler()
The SSM document that includes the pre and/or post scripts to run.
-
If you are automating VSS backups, specify
AWS_VSS_BACKUP. In this case, Amazon Data Lifecycle Manager automatically uses theAWSEC2-CreateVssSnapshotSSM document. -
If you are using a custom SSM document that you own, specify either the name or ARN of the SSM document. If you are using a custom SSM document that is shared with you, specify the ARN of the SSM document.
- Returns:
- The SSM document that includes the pre and/or post scripts to run.
-
If you are automating VSS backups, specify
AWS_VSS_BACKUP. In this case, Amazon Data Lifecycle Manager automatically uses theAWSEC2-CreateVssSnapshotSSM document. -
If you are using a custom SSM document that you own, specify either the name or ARN of the SSM document. If you are using a custom SSM document that is shared with you, specify the ARN of the SSM document.
-
-
-
executeOperationOnScriptFailure
public final Boolean executeOperationOnScriptFailure()
Indicates whether Amazon Data Lifecycle Manager should default to crash-consistent snapshots if the pre script fails.
-
To default to crash consistent snapshot if the pre script fails, specify
true. -
To skip the instance for snapshot creation if the pre script fails, specify
false.
This parameter is supported only if you run a pre script. If you run a post script only, omit this parameter.
Default: true
- Returns:
- Indicates whether Amazon Data Lifecycle Manager should default to crash-consistent snapshots if the pre
script fails.
-
To default to crash consistent snapshot if the pre script fails, specify
true. -
To skip the instance for snapshot creation if the pre script fails, specify
false.
This parameter is supported only if you run a pre script. If you run a post script only, omit this parameter.
Default: true
-
-
-
executionTimeout
public final Integer executionTimeout()
Specifies a timeout period, in seconds, after which Amazon Data Lifecycle Manager fails the script run attempt if it has not completed. If a script does not complete within its timeout period, Amazon Data Lifecycle Manager fails the attempt. The timeout period applies to the pre and post scripts individually.
If you are automating VSS Backups, omit this parameter.
Default: 10
- Returns:
- Specifies a timeout period, in seconds, after which Amazon Data Lifecycle Manager fails the script run
attempt if it has not completed. If a script does not complete within its timeout period, Amazon Data
Lifecycle Manager fails the attempt. The timeout period applies to the pre and post scripts individually.
If you are automating VSS Backups, omit this parameter.
Default: 10
-
maximumRetryCount
public final Integer maximumRetryCount()
Specifies the number of times Amazon Data Lifecycle Manager should retry scripts that fail.
-
If the pre script fails, Amazon Data Lifecycle Manager retries the entire snapshot creation process, including running the pre and post scripts.
-
If the post script fails, Amazon Data Lifecycle Manager retries the post script only; in this case, the pre script will have completed and the snapshot might have been created.
If you do not want Amazon Data Lifecycle Manager to retry failed scripts, specify
0.Default: 0
- Returns:
- Specifies the number of times Amazon Data Lifecycle Manager should retry scripts that fail.
-
If the pre script fails, Amazon Data Lifecycle Manager retries the entire snapshot creation process, including running the pre and post scripts.
-
If the post script fails, Amazon Data Lifecycle Manager retries the post script only; in this case, the pre script will have completed and the snapshot might have been created.
If you do not want Amazon Data Lifecycle Manager to retry failed scripts, specify
0.Default: 0
-
-
-
toBuilder
public Script.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<Script.Builder,Script>
-
builder
public static Script.Builder builder()
-
serializableBuilderClass
public static Class<? extends Script.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.
-
-