#[non_exhaustive]pub struct ScriptBuilder { /* private fields */ }
Expand description
A builder for Script
.
Implementations§
Source§impl ScriptBuilder
impl ScriptBuilder
Sourcepub fn stages(self, input: StageValues) -> Self
pub fn stages(self, input: StageValues) -> Self
Appends an item to stages
.
To override the contents of this collection use set_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
Sourcepub fn set_stages(self, input: Option<Vec<StageValues>>) -> Self
pub fn set_stages(self, input: Option<Vec<StageValues>>) -> Self
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
Sourcepub fn get_stages(&self) -> &Option<Vec<StageValues>>
pub fn get_stages(&self) -> &Option<Vec<StageValues>>
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
Sourcepub fn execution_handler_service(
self,
input: ExecutionHandlerServiceValues,
) -> Self
pub fn execution_handler_service( self, input: ExecutionHandlerServiceValues, ) -> Self
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
Sourcepub fn set_execution_handler_service(
self,
input: Option<ExecutionHandlerServiceValues>,
) -> Self
pub fn set_execution_handler_service( self, input: Option<ExecutionHandlerServiceValues>, ) -> Self
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
Sourcepub fn get_execution_handler_service(
&self,
) -> &Option<ExecutionHandlerServiceValues>
pub fn get_execution_handler_service( &self, ) -> &Option<ExecutionHandlerServiceValues>
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
Sourcepub fn execution_handler(self, input: impl Into<String>) -> Self
pub fn execution_handler(self, input: impl Into<String>) -> Self
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.
Sourcepub fn set_execution_handler(self, input: Option<String>) -> Self
pub fn set_execution_handler(self, input: Option<String>) -> Self
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.
Sourcepub fn get_execution_handler(&self) -> &Option<String>
pub fn get_execution_handler(&self) -> &Option<String>
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.
Sourcepub fn execute_operation_on_script_failure(self, input: bool) -> Self
pub fn execute_operation_on_script_failure(self, input: bool) -> Self
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
Sourcepub fn set_execute_operation_on_script_failure(
self,
input: Option<bool>,
) -> Self
pub fn set_execute_operation_on_script_failure( self, input: Option<bool>, ) -> Self
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
Sourcepub fn get_execute_operation_on_script_failure(&self) -> &Option<bool>
pub fn get_execute_operation_on_script_failure(&self) -> &Option<bool>
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
Sourcepub fn execution_timeout(self, input: i32) -> Self
pub fn execution_timeout(self, input: i32) -> Self
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
Sourcepub fn set_execution_timeout(self, input: Option<i32>) -> Self
pub fn set_execution_timeout(self, input: Option<i32>) -> Self
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
Sourcepub fn get_execution_timeout(&self) -> &Option<i32>
pub fn get_execution_timeout(&self) -> &Option<i32>
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
Sourcepub fn maximum_retry_count(self, input: i32) -> Self
pub fn maximum_retry_count(self, input: i32) -> Self
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
Sourcepub fn set_maximum_retry_count(self, input: Option<i32>) -> Self
pub fn set_maximum_retry_count(self, input: Option<i32>) -> Self
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
Sourcepub fn get_maximum_retry_count(&self) -> &Option<i32>
pub fn get_maximum_retry_count(&self) -> &Option<i32>
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
Trait Implementations§
Source§impl Clone for ScriptBuilder
impl Clone for ScriptBuilder
Source§fn clone(&self) -> ScriptBuilder
fn clone(&self) -> ScriptBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ScriptBuilder
impl Debug for ScriptBuilder
Source§impl Default for ScriptBuilder
impl Default for ScriptBuilder
Source§fn default() -> ScriptBuilder
fn default() -> ScriptBuilder
Source§impl PartialEq for ScriptBuilder
impl PartialEq for ScriptBuilder
impl StructuralPartialEq for ScriptBuilder
Auto Trait Implementations§
impl Freeze for ScriptBuilder
impl RefUnwindSafe for ScriptBuilder
impl Send for ScriptBuilder
impl Sync for ScriptBuilder
impl Unpin for ScriptBuilder
impl UnwindSafe for ScriptBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);