pub struct Client { /* private fields */ }
Expand description
Client for AWS Snow Device Management
Client for invoking operations on AWS Snow Device Management. Each operation on AWS Snow Device Management 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_snowdevicemanagement::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Builder
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_snowdevicemanagement::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 CancelTask
operation has
a Client::cancel_task
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.cancel_task()
.task_id("example")
.send()
.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 cancel_task(&self) -> CancelTaskFluentBuilder
pub fn cancel_task(&self) -> CancelTaskFluentBuilder
Constructs a fluent builder for the CancelTask
operation.
- The fluent builder is configurable:
task_id(impl Into<String>)
/set_task_id(Option<String>)
:
required: trueThe ID of the task that you are attempting to cancel. You can retrieve a task ID by using the
ListTasks
operation.
- On success, responds with
CancelTaskOutput
with field(s):task_id(Option<String>)
:The ID of the task that you are attempting to cancel.
- On failure, responds with
SdkError<CancelTaskError>
Source§impl Client
impl Client
Sourcepub fn create_task(&self) -> CreateTaskFluentBuilder
pub fn create_task(&self) -> CreateTaskFluentBuilder
Constructs a fluent builder for the CreateTask
operation.
- The fluent builder is configurable:
targets(impl Into<String>)
/set_targets(Option<Vec::<String>>)
:
required: trueA list of managed device IDs.
command(Command)
/set_command(Option<Command>)
:
required: trueThe task to be performed. Only one task is executed on a device at a time.
description(impl Into<String>)
/set_description(Option<String>)
:
required: falseA description of the task and its targets.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseOptional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:
required: falseA token ensuring that the action is called only once with the specified details.
- On success, responds with
CreateTaskOutput
with field(s):task_id(Option<String>)
:The ID of the task that you created.
task_arn(Option<String>)
:The Amazon Resource Name (ARN) of the task that you created.
- On failure, responds with
SdkError<CreateTaskError>
Source§impl Client
impl Client
Sourcepub fn describe_device(&self) -> DescribeDeviceFluentBuilder
pub fn describe_device(&self) -> DescribeDeviceFluentBuilder
Constructs a fluent builder for the DescribeDevice
operation.
- The fluent builder is configurable:
managed_device_id(impl Into<String>)
/set_managed_device_id(Option<String>)
:
required: trueThe ID of the device that you are checking the information of.
- On success, responds with
DescribeDeviceOutput
with field(s):last_reached_out_at(Option<DateTime>)
:When the device last contacted the Amazon Web Services Cloud. Indicates that the device is online.
last_updated_at(Option<DateTime>)
:When the device last pushed an update to the Amazon Web Services Cloud. Indicates when the device cache was refreshed.
tags(Option<HashMap::<String, String>>)
:Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
managed_device_id(Option<String>)
:The ID of the device that you checked the information for.
managed_device_arn(Option<String>)
:The Amazon Resource Name (ARN) of the device.
device_type(Option<String>)
:The type of Amazon Web Services Snow Family device.
associated_with_job(Option<String>)
:The ID of the job used when ordering the device.
device_state(Option<UnlockState>)
:The current state of the device.
physical_network_interfaces(Option<Vec::<PhysicalNetworkInterface>>)
:The network interfaces available on the device.
device_capacities(Option<Vec::<Capacity>>)
:The hardware specifications of the device.
software(Option<SoftwareInformation>)
:The software installed on the device.
- On failure, responds with
SdkError<DescribeDeviceError>
Source§impl Client
impl Client
Sourcepub fn describe_device_ec2_instances(
&self,
) -> DescribeDeviceEc2InstancesFluentBuilder
pub fn describe_device_ec2_instances( &self, ) -> DescribeDeviceEc2InstancesFluentBuilder
Constructs a fluent builder for the DescribeDeviceEc2Instances
operation.
- The fluent builder is configurable:
managed_device_id(impl Into<String>)
/set_managed_device_id(Option<String>)
:
required: trueThe ID of the managed device.
instance_ids(impl Into<String>)
/set_instance_ids(Option<Vec::<String>>)
:
required: trueA list of instance IDs associated with the managed device.
- On success, responds with
DescribeDeviceEc2InstancesOutput
with field(s):instances(Option<Vec::<InstanceSummary>>)
:A list of structures containing information about each instance.
- On failure, responds with
SdkError<DescribeDeviceEc2InstancesError>
Source§impl Client
impl Client
Sourcepub fn describe_execution(&self) -> DescribeExecutionFluentBuilder
pub fn describe_execution(&self) -> DescribeExecutionFluentBuilder
Constructs a fluent builder for the DescribeExecution
operation.
- The fluent builder is configurable:
task_id(impl Into<String>)
/set_task_id(Option<String>)
:
required: trueThe ID of the task that the action is describing.
managed_device_id(impl Into<String>)
/set_managed_device_id(Option<String>)
:
required: trueThe ID of the managed device.
- On success, responds with
DescribeExecutionOutput
with field(s):task_id(Option<String>)
:The ID of the task being executed on the device.
execution_id(Option<String>)
:The ID of the execution.
managed_device_id(Option<String>)
:The ID of the managed device that the task is being executed on.
state(Option<ExecutionState>)
:The current state of the execution.
started_at(Option<DateTime>)
:When the execution began.
last_updated_at(Option<DateTime>)
:When the status of the execution was last updated.
- On failure, responds with
SdkError<DescribeExecutionError>
Source§impl Client
impl Client
Sourcepub fn describe_task(&self) -> DescribeTaskFluentBuilder
pub fn describe_task(&self) -> DescribeTaskFluentBuilder
Constructs a fluent builder for the DescribeTask
operation.
- The fluent builder is configurable:
task_id(impl Into<String>)
/set_task_id(Option<String>)
:
required: trueThe ID of the task to be described.
- On success, responds with
DescribeTaskOutput
with field(s):task_id(Option<String>)
:The ID of the task.
task_arn(Option<String>)
:The Amazon Resource Name (ARN) of the task.
targets(Option<Vec::<String>>)
:The managed devices that the task was sent to.
state(Option<TaskState>)
:The current state of the task.
created_at(Option<DateTime>)
:When the
CreateTask
operation was called.last_updated_at(Option<DateTime>)
:When the state of the task was last updated.
completed_at(Option<DateTime>)
:When the task was completed.
description(Option<String>)
:The description provided of the task and managed devices.
tags(Option<HashMap::<String, String>>)
:Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
- On failure, responds with
SdkError<DescribeTaskError>
Source§impl Client
impl Client
Sourcepub fn list_device_resources(&self) -> ListDeviceResourcesFluentBuilder
pub fn list_device_resources(&self) -> ListDeviceResourcesFluentBuilder
Constructs a fluent builder for the ListDeviceResources
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
managed_device_id(impl Into<String>)
/set_managed_device_id(Option<String>)
:
required: trueThe ID of the managed device that you are listing the resources of.
r#type(impl Into<String>)
/set_type(Option<String>)
:
required: falseA structure used to filter the results by type of resource.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of resources per page.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA pagination token to continue to the next page of results.
- On success, responds with
ListDeviceResourcesOutput
with field(s):resources(Option<Vec::<ResourceSummary>>)
:A structure defining the resource’s type, Amazon Resource Name (ARN), and ID.
next_token(Option<String>)
:A pagination token to continue to the next page of results.
- On failure, responds with
SdkError<ListDeviceResourcesError>
Source§impl Client
impl Client
Sourcepub fn list_devices(&self) -> ListDevicesFluentBuilder
pub fn list_devices(&self) -> ListDevicesFluentBuilder
Constructs a fluent builder for the ListDevices
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
job_id(impl Into<String>)
/set_job_id(Option<String>)
:
required: falseThe ID of the job used to order the device.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of devices to list per page.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA pagination token to continue to the next page of results.
- On success, responds with
ListDevicesOutput
with field(s):devices(Option<Vec::<DeviceSummary>>)
:A list of device structures that contain information about the device.
next_token(Option<String>)
:A pagination token to continue to the next page of devices.
- On failure, responds with
SdkError<ListDevicesError>
Source§impl Client
impl Client
Sourcepub fn list_executions(&self) -> ListExecutionsFluentBuilder
pub fn list_executions(&self) -> ListExecutionsFluentBuilder
Constructs a fluent builder for the ListExecutions
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
task_id(impl Into<String>)
/set_task_id(Option<String>)
:
required: trueThe ID of the task.
state(ExecutionState)
/set_state(Option<ExecutionState>)
:
required: falseA structure used to filter the tasks by their current state.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of tasks to list per page.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA pagination token to continue to the next page of tasks.
- On success, responds with
ListExecutionsOutput
with field(s):executions(Option<Vec::<ExecutionSummary>>)
:A list of executions. Each execution contains the task ID, the device that the task is executing on, the execution ID, and the status of the execution.
next_token(Option<String>)
:A pagination token to continue to the next page of executions.
- On failure, responds with
SdkError<ListExecutionsError>
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>)
:
required: trueThe Amazon Resource Name (ARN) of the device or task.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap::<String, String>>)
:The list of tags for the device or task.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn list_tasks(&self) -> ListTasksFluentBuilder
pub fn list_tasks(&self) -> ListTasksFluentBuilder
Constructs a fluent builder for the ListTasks
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
state(TaskState)
/set_state(Option<TaskState>)
:
required: falseA structure used to filter the list of tasks.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of tasks per page.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseA pagination token to continue to the next page of tasks.
- On success, responds with
ListTasksOutput
with field(s):tasks(Option<Vec::<TaskSummary>>)
:A list of task structures containing details about each task.
next_token(Option<String>)
:A pagination token to continue to the next page of tasks.
- On failure, responds with
SdkError<ListTasksError>
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>)
:
required: trueThe Amazon Resource Name (ARN) of the device or task.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueOptional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
- 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>)
:
required: trueThe Amazon Resource Name (ARN) of the device or task.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueOptional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
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 in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
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_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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);