Struct aws_sdk_dlm::Client
source · pub struct Client { /* private fields */ }Expand description
Client for Amazon Data Lifecycle Manager
Client for invoking operations on Amazon Data Lifecycle Manager. Each operation on Amazon Data Lifecycle Manager is a method on this
this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.
Constructing a Client
A Config is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env() instead, which returns a ConfigLoader that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_dlm::Client::new(&config);Occasionally, SDKs may have additional service-specific that can be set on the Config that
is absent from SdkConfig, or slightly different settings for a specific client may be desired.
The Config struct implements From<&SdkConfig>, so setting these specific settings can be
done as follows:
let sdk_config = aws_config::load_from_env().await;
let config = aws_sdk_dlm::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();See the aws-config docs and Config for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateLifecyclePolicy operation has
a Client::create_lifecycle_policy, function which returns a builder for that operation.
The fluent builder ultimately has a call() function that returns an async future that
returns a result, as illustrated below:
let result = client.create_lifecycle_policy()
.execution_role_arn("example")
.call()
.await;The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize module for more
information.
Implementations§
source§impl Client
impl Client
sourcepub fn create_lifecycle_policy(&self) -> CreateLifecyclePolicyFluentBuilder
pub fn create_lifecycle_policy(&self) -> CreateLifecyclePolicyFluentBuilder
Constructs a fluent builder for the CreateLifecyclePolicy operation.
- The fluent builder is configurable:
execution_role_arn(impl Into<String>)/set_execution_role_arn(Option<String>):The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
description(impl Into<String>)/set_description(Option<String>):A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$ are supported.
state(SettablePolicyStateValues)/set_state(Option<SettablePolicyStateValues>):The desired activation state of the lifecycle policy after creation.
policy_details(PolicyDetails)/set_policy_details(Option<PolicyDetails>):The configuration details of the lifecycle policy.
tags(HashMap<String, String>)/set_tags(Option<HashMap<String, String>>):The tags to apply to the lifecycle policy during creation.
- On success, responds with
CreateLifecyclePolicyOutputwith field(s):policy_id(Option<String>):The identifier of the lifecycle policy.
- On failure, responds with
SdkError<CreateLifecyclePolicyError>
source§impl Client
impl Client
sourcepub fn delete_lifecycle_policy(&self) -> DeleteLifecyclePolicyFluentBuilder
pub fn delete_lifecycle_policy(&self) -> DeleteLifecyclePolicyFluentBuilder
Constructs a fluent builder for the DeleteLifecyclePolicy operation.
- The fluent builder is configurable:
policy_id(impl Into<String>)/set_policy_id(Option<String>):The identifier of the lifecycle policy.
- On success, responds with
DeleteLifecyclePolicyOutput - On failure, responds with
SdkError<DeleteLifecyclePolicyError>
source§impl Client
impl Client
sourcepub fn get_lifecycle_policies(&self) -> GetLifecyclePoliciesFluentBuilder
pub fn get_lifecycle_policies(&self) -> GetLifecyclePoliciesFluentBuilder
Constructs a fluent builder for the GetLifecyclePolicies operation.
- The fluent builder is configurable:
policy_ids(Vec<String>)/set_policy_ids(Option<Vec<String>>):The identifiers of the data lifecycle policies.
state(GettablePolicyStateValues)/set_state(Option<GettablePolicyStateValues>):The activation state.
resource_types(Vec<ResourceTypeValues>)/set_resource_types(Option<Vec<ResourceTypeValues>>):The resource type.
target_tags(Vec<String>)/set_target_tags(Option<Vec<String>>):The target tag for a policy.
Tags are strings in the format
key=value.tags_to_add(Vec<String>)/set_tags_to_add(Option<Vec<String>>):The tags to add to objects created by the policy.
Tags are strings in the format
key=value.These user-defined tags are added in addition to the Amazon Web Services-added lifecycle tags.
- On success, responds with
GetLifecyclePoliciesOutputwith field(s):policies(Option<Vec<LifecyclePolicySummary>>):Summary information about the lifecycle policies.
- On failure, responds with
SdkError<GetLifecyclePoliciesError>
source§impl Client
impl Client
sourcepub fn get_lifecycle_policy(&self) -> GetLifecyclePolicyFluentBuilder
pub fn get_lifecycle_policy(&self) -> GetLifecyclePolicyFluentBuilder
Constructs a fluent builder for the GetLifecyclePolicy operation.
- The fluent builder is configurable:
policy_id(impl Into<String>)/set_policy_id(Option<String>):The identifier of the lifecycle policy.
- On success, responds with
GetLifecyclePolicyOutputwith field(s):policy(Option<LifecyclePolicy>):Detailed information about the lifecycle policy.
- On failure, responds with
SdkError<GetLifecyclePolicyError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):The Amazon Resource Name (ARN) of the resource.
- On success, responds with
ListTagsForResourceOutputwith field(s):tags(Option<HashMap<String, String>>):Information about the tags.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):The Amazon Resource Name (ARN) of the resource.
tags(HashMap<String, String>)/set_tags(Option<HashMap<String, String>>):One or more tags.
- On success, responds with
TagResourceOutput - On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):The Amazon Resource Name (ARN) of the resource.
tag_keys(Vec<String>)/set_tag_keys(Option<Vec<String>>):The tag keys.
- On success, responds with
UntagResourceOutput - On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_lifecycle_policy(&self) -> UpdateLifecyclePolicyFluentBuilder
pub fn update_lifecycle_policy(&self) -> UpdateLifecyclePolicyFluentBuilder
Constructs a fluent builder for the UpdateLifecyclePolicy operation.
- The fluent builder is configurable:
policy_id(impl Into<String>)/set_policy_id(Option<String>):The identifier of the lifecycle policy.
execution_role_arn(impl Into<String>)/set_execution_role_arn(Option<String>):The Amazon Resource Name (ARN) of the IAM role used to run the operations specified by the lifecycle policy.
state(SettablePolicyStateValues)/set_state(Option<SettablePolicyStateValues>):The desired activation state of the lifecycle policy after creation.
description(impl Into<String>)/set_description(Option<String>):A description of the lifecycle policy.
policy_details(PolicyDetails)/set_policy_details(Option<PolicyDetails>):The configuration of the lifecycle policy. You cannot update the policy type or the resource type.
- On success, responds with
UpdateLifecyclePolicyOutput - On failure, responds with
SdkError<UpdateLifecyclePolicyError>
source§impl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config( client: Client<DynConnector, DynMiddleware<DynConnector>>, conf: Config ) -> Self
Creates a client with the given service configuration.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
Panics
- This method will panic if the
sdk_configis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it. - This method will panic if the
sdk_configis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it.
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config.
Panics
- This method will panic if the
confis missing an async sleep implementation. If you experience this panic, set thesleep_implon the Config passed into this function to fix it. - This method will panic if the
confis missing an HTTP connector. If you experience this panic, set thehttp_connectoron the Config passed into this function to fix it.