Class Script
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<Script.Builder,
Script>
[Custom 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:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Script.Builder
builder()
final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final Boolean
Indicates whether Amazon Data Lifecycle Manager should default to crash-consistent snapshots if the pre script fails.final String
The SSM document that includes the pre and/or post scripts to run.Indicates the service used to execute the pre and/or post scripts.final String
Indicates the service used to execute the pre and/or post scripts.final Integer
Specifies a timeout period, in seconds, after which Amazon Data Lifecycle Manager fails the script run attempt if it has not completed.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 Stages property.final Integer
Specifies the number of times Amazon Data Lifecycle Manager should retry scripts that fail.static Class
<? extends Script.Builder> final List
<StageValues> stages()
Indicate which scripts Amazon Data Lifecycle Manager should run on target instances.Indicate which scripts Amazon Data Lifecycle Manager should run on target instances.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
-
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-script
parameter 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-script
parameter after initiating snapshot creation. -
To run both pre and post scripts, specify both
PRE
andPOST
. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-script
parameter before initiating snapshot creation, and then it calls the SSM document again with thepost-script
parameter 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-script
parameter 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-script
parameter after initiating snapshot creation. -
To run both pre and post scripts, specify both
PRE
andPOST
. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-script
parameter before initiating snapshot creation, and then it calls the SSM document again with thepost-script
parameter 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
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-script
parameter 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-script
parameter after initiating snapshot creation. -
To run both pre and post scripts, specify both
PRE
andPOST
. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-script
parameter before initiating snapshot creation, and then it calls the SSM document again with thepost-script
parameter 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-script
parameter 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-script
parameter after initiating snapshot creation. -
To run both pre and post scripts, specify both
PRE
andPOST
. In this case, Amazon Data Lifecycle Manager calls the SSM document with thepre-script
parameter before initiating snapshot creation, and then it calls the SSM document again with thepost-script
parameter after initiating snapshot creation.
If you are automating VSS Backups, omit this parameter.
Default: PRE and POST
-
-
-
executionHandlerService
Indicates the service used to execute the pre and/or post scripts.
-
If you are using custom SSM documents or automating application-consistent snapshots of SAP HANA workloads, 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,
executionHandlerService
will 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 or automating application-consistent snapshots of SAP HANA workloads, specify
AWS_SYSTEMS_MANAGER
. -
If you are automating VSS Backups, omit this parameter.
Default: AWS_SYSTEMS_MANAGER
-
- See Also:
-
-
executionHandlerServiceAsString
Indicates the service used to execute the pre and/or post scripts.
-
If you are using custom SSM documents or automating application-consistent snapshots of SAP HANA workloads, 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,
executionHandlerService
will 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 or automating application-consistent snapshots of SAP HANA workloads, specify
AWS_SYSTEMS_MANAGER
. -
If you are automating VSS Backups, omit this parameter.
Default: AWS_SYSTEMS_MANAGER
-
- See Also:
-
-
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-CreateVssSnapshot
SSM document. -
If you are automating application-consistent snapshots for SAP HANA workloads, specify
AWSSystemsManagerSAP-CreateDLMSnapshotForSAPHANA
. -
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-CreateVssSnapshot
SSM document. -
If you are automating application-consistent snapshots for SAP HANA workloads, specify
AWSSystemsManagerSAP-CreateDLMSnapshotForSAPHANA
. -
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
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
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
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
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<Script.Builder,
Script> - 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
-