Struct aws_sdk_migrationhub::Client
source · pub struct Client { /* private fields */ }Expand description
Client for AWS Migration Hub
Client for invoking operations on AWS Migration Hub. Each operation on AWS Migration Hub 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_migrationhub::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_migrationhub::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 AssociateCreatedArtifact operation has
a Client::associate_created_artifact, 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.associate_created_artifact()
.progress_update_stream("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 associate_created_artifact(
&self
) -> AssociateCreatedArtifactFluentBuilder
pub fn associate_created_artifact( &self ) -> AssociateCreatedArtifactFluentBuilder
Constructs a fluent builder for the AssociateCreatedArtifact operation.
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueUnique identifier that references the migration task. Do not store personal data in this field.
created_artifact(CreatedArtifact)/set_created_artifact(Option<CreatedArtifact>):
required: trueAn ARN of the AWS resource related to the migration (e.g., AMI, EC2 instance, RDS instance, etc.)
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
AssociateCreatedArtifactOutput - On failure, responds with
SdkError<AssociateCreatedArtifactError>
source§impl Client
impl Client
sourcepub fn associate_discovered_resource(
&self
) -> AssociateDiscoveredResourceFluentBuilder
pub fn associate_discovered_resource( &self ) -> AssociateDiscoveredResourceFluentBuilder
Constructs a fluent builder for the AssociateDiscoveredResource operation.
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueThe identifier given to the MigrationTask. Do not store personal data in this field.
discovered_resource(DiscoveredResource)/set_discovered_resource(Option<DiscoveredResource>):
required: trueObject representing a Resource.
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
AssociateDiscoveredResourceOutput - On failure, responds with
SdkError<AssociateDiscoveredResourceError>
source§impl Client
impl Client
sourcepub fn create_progress_update_stream(
&self
) -> CreateProgressUpdateStreamFluentBuilder
pub fn create_progress_update_stream( &self ) -> CreateProgressUpdateStreamFluentBuilder
Constructs a fluent builder for the CreateProgressUpdateStream operation.
- The fluent builder is configurable:
progress_update_stream_name(impl Into<String>)/set_progress_update_stream_name(Option<String>):
required: trueThe name of the ProgressUpdateStream. Do not store personal data in this field.
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
CreateProgressUpdateStreamOutput - On failure, responds with
SdkError<CreateProgressUpdateStreamError>
source§impl Client
impl Client
sourcepub fn delete_progress_update_stream(
&self
) -> DeleteProgressUpdateStreamFluentBuilder
pub fn delete_progress_update_stream( &self ) -> DeleteProgressUpdateStreamFluentBuilder
Constructs a fluent builder for the DeleteProgressUpdateStream operation.
- The fluent builder is configurable:
progress_update_stream_name(impl Into<String>)/set_progress_update_stream_name(Option<String>):
required: trueThe name of the ProgressUpdateStream. Do not store personal data in this field.
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
DeleteProgressUpdateStreamOutput - On failure, responds with
SdkError<DeleteProgressUpdateStreamError>
source§impl Client
impl Client
sourcepub fn describe_application_state(
&self
) -> DescribeApplicationStateFluentBuilder
pub fn describe_application_state( &self ) -> DescribeApplicationStateFluentBuilder
Constructs a fluent builder for the DescribeApplicationState operation.
- The fluent builder is configurable:
application_id(impl Into<String>)/set_application_id(Option<String>):
required: trueThe configurationId in Application Discovery Service that uniquely identifies the grouped application.
- On success, responds with
DescribeApplicationStateOutputwith field(s):application_status(Option<ApplicationStatus>):Status of the application - Not Started, In-Progress, Complete.
last_updated_time(Option<DateTime>):The timestamp when the application status was last updated.
- On failure, responds with
SdkError<DescribeApplicationStateError>
source§impl Client
impl Client
sourcepub fn describe_migration_task(&self) -> DescribeMigrationTaskFluentBuilder
pub fn describe_migration_task(&self) -> DescribeMigrationTaskFluentBuilder
Constructs a fluent builder for the DescribeMigrationTask operation.
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueThe identifier given to the MigrationTask. Do not store personal data in this field.
- On success, responds with
DescribeMigrationTaskOutputwith field(s):migration_task(Option<MigrationTask>):Object encapsulating information about the migration task.
- On failure, responds with
SdkError<DescribeMigrationTaskError>
source§impl Client
impl Client
sourcepub fn disassociate_created_artifact(
&self
) -> DisassociateCreatedArtifactFluentBuilder
pub fn disassociate_created_artifact( &self ) -> DisassociateCreatedArtifactFluentBuilder
Constructs a fluent builder for the DisassociateCreatedArtifact operation.
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueUnique identifier that references the migration task to be disassociated with the artifact. Do not store personal data in this field.
created_artifact_name(impl Into<String>)/set_created_artifact_name(Option<String>):
required: trueAn ARN of the AWS resource related to the migration (e.g., AMI, EC2 instance, RDS instance, etc.)
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
DisassociateCreatedArtifactOutput - On failure, responds with
SdkError<DisassociateCreatedArtifactError>
source§impl Client
impl Client
sourcepub fn disassociate_discovered_resource(
&self
) -> DisassociateDiscoveredResourceFluentBuilder
pub fn disassociate_discovered_resource( &self ) -> DisassociateDiscoveredResourceFluentBuilder
Constructs a fluent builder for the DisassociateDiscoveredResource operation.
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueThe identifier given to the MigrationTask. Do not store personal data in this field.
configuration_id(impl Into<String>)/set_configuration_id(Option<String>):
required: trueConfigurationId of the Application Discovery Service resource to be disassociated.
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
DisassociateDiscoveredResourceOutput - On failure, responds with
SdkError<DisassociateDiscoveredResourceError>
source§impl Client
impl Client
sourcepub fn import_migration_task(&self) -> ImportMigrationTaskFluentBuilder
pub fn import_migration_task(&self) -> ImportMigrationTaskFluentBuilder
Constructs a fluent builder for the ImportMigrationTask operation.
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream. >
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueUnique identifier that references the migration task. Do not store personal data in this field.
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
ImportMigrationTaskOutput - On failure, responds with
SdkError<ImportMigrationTaskError>
source§impl Client
impl Client
sourcepub fn list_application_states(&self) -> ListApplicationStatesFluentBuilder
pub fn list_application_states(&self) -> ListApplicationStatesFluentBuilder
Constructs a fluent builder for the ListApplicationStates operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
application_ids(impl Into<String>)/set_application_ids(Option<Vec::<String>>):
required: falseThe configurationIds from the Application Discovery Service that uniquely identifies your applications.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf a
NextTokenwas returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token inNextToken.max_results(i32)/set_max_results(Option<i32>):
required: falseMaximum number of results to be returned per page.
- On success, responds with
ListApplicationStatesOutputwith field(s):application_state_list(Option<Vec::<ApplicationState>>):A list of Applications that exist in Application Discovery Service.
next_token(Option<String>):If a
NextTokenwas returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token inNextToken.
- On failure, responds with
SdkError<ListApplicationStatesError>
source§impl Client
impl Client
sourcepub fn list_created_artifacts(&self) -> ListCreatedArtifactsFluentBuilder
pub fn list_created_artifacts(&self) -> ListCreatedArtifactsFluentBuilder
Constructs a fluent builder for the ListCreatedArtifacts operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueUnique identifier that references the migration task. Do not store personal data in this field.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf a
NextTokenwas returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token inNextToken.max_results(i32)/set_max_results(Option<i32>):
required: falseMaximum number of results to be returned per page.
- On success, responds with
ListCreatedArtifactsOutputwith field(s):next_token(Option<String>):If there are more created artifacts than the max result, return the next token to be passed to the next call as a bookmark of where to start from.
created_artifact_list(Option<Vec::<CreatedArtifact>>):List of created artifacts up to the maximum number of results specified in the request.
- On failure, responds with
SdkError<ListCreatedArtifactsError>
source§impl Client
impl Client
sourcepub fn list_discovered_resources(&self) -> ListDiscoveredResourcesFluentBuilder
pub fn list_discovered_resources(&self) -> ListDiscoveredResourcesFluentBuilder
Constructs a fluent builder for the ListDiscoveredResources operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueThe name of the MigrationTask. Do not store personal data in this field.
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf a
NextTokenwas returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token inNextToken.max_results(i32)/set_max_results(Option<i32>):
required: falseThe maximum number of results returned per page.
- On success, responds with
ListDiscoveredResourcesOutputwith field(s):next_token(Option<String>):If there are more discovered resources than the max result, return the next token to be passed to the next call as a bookmark of where to start from.
discovered_resource_list(Option<Vec::<DiscoveredResource>>):Returned list of discovered resources associated with the given MigrationTask.
- On failure, responds with
SdkError<ListDiscoveredResourcesError>
source§impl Client
impl Client
sourcepub fn list_migration_tasks(&self) -> ListMigrationTasksFluentBuilder
pub fn list_migration_tasks(&self) -> ListMigrationTasksFluentBuilder
Constructs a fluent builder for the ListMigrationTasks operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf a
NextTokenwas returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token inNextToken.max_results(i32)/set_max_results(Option<i32>):
required: falseValue to specify how many results are returned per page.
resource_name(impl Into<String>)/set_resource_name(Option<String>):
required: falseFilter migration tasks by discovered resource name.
- On success, responds with
ListMigrationTasksOutputwith field(s):next_token(Option<String>):If there are more migration tasks than the max result, return the next token to be passed to the next call as a bookmark of where to start from.
migration_task_summary_list(Option<Vec::<MigrationTaskSummary>>):Lists the migration task’s summary which includes:
MigrationTaskName,ProgressPercent,ProgressUpdateStream,Status, and theUpdateDateTimefor each task.
- On failure, responds with
SdkError<ListMigrationTasksError>
source§impl Client
impl Client
sourcepub fn list_progress_update_streams(
&self
) -> ListProgressUpdateStreamsFluentBuilder
pub fn list_progress_update_streams( &self ) -> ListProgressUpdateStreamsFluentBuilder
Constructs a fluent builder for the ListProgressUpdateStreams operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
next_token(impl Into<String>)/set_next_token(Option<String>):
required: falseIf a
NextTokenwas returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token inNextToken.max_results(i32)/set_max_results(Option<i32>):
required: falseFilter to limit the maximum number of results to list per page.
- On success, responds with
ListProgressUpdateStreamsOutputwith field(s):progress_update_stream_summary_list(Option<Vec::<ProgressUpdateStreamSummary>>):List of progress update streams up to the max number of results passed in the input.
next_token(Option<String>):If there are more streams created than the max result, return the next token to be passed to the next call as a bookmark of where to start from.
- On failure, responds with
SdkError<ListProgressUpdateStreamsError>
source§impl Client
impl Client
sourcepub fn notify_application_state(&self) -> NotifyApplicationStateFluentBuilder
pub fn notify_application_state(&self) -> NotifyApplicationStateFluentBuilder
Constructs a fluent builder for the NotifyApplicationState operation.
- The fluent builder is configurable:
application_id(impl Into<String>)/set_application_id(Option<String>):
required: trueThe configurationId in Application Discovery Service that uniquely identifies the grouped application.
status(ApplicationStatus)/set_status(Option<ApplicationStatus>):
required: trueStatus of the application - Not Started, In-Progress, Complete.
update_date_time(DateTime)/set_update_date_time(Option<DateTime>):
required: falseThe timestamp when the application state changed.
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
NotifyApplicationStateOutput - On failure, responds with
SdkError<NotifyApplicationStateError>
source§impl Client
impl Client
sourcepub fn notify_migration_task_state(
&self
) -> NotifyMigrationTaskStateFluentBuilder
pub fn notify_migration_task_state( &self ) -> NotifyMigrationTaskStateFluentBuilder
Constructs a fluent builder for the NotifyMigrationTaskState operation.
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueUnique identifier that references the migration task. Do not store personal data in this field.
task(Task)/set_task(Option<Task>):
required: trueInformation about the task’s progress and status.
update_date_time(DateTime)/set_update_date_time(Option<DateTime>):
required: trueThe timestamp when the task was gathered.
next_update_seconds(i32)/set_next_update_seconds(Option<i32>):
required: trueNumber of seconds after the UpdateDateTime within which the Migration Hub can expect an update. If Migration Hub does not receive an update within the specified interval, then the migration task will be considered stale.
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
NotifyMigrationTaskStateOutput - On failure, responds with
SdkError<NotifyMigrationTaskStateError>
source§impl Client
impl Client
sourcepub fn put_resource_attributes(&self) -> PutResourceAttributesFluentBuilder
pub fn put_resource_attributes(&self) -> PutResourceAttributesFluentBuilder
Constructs a fluent builder for the PutResourceAttributes operation.
- The fluent builder is configurable:
progress_update_stream(impl Into<String>)/set_progress_update_stream(Option<String>):
required: trueThe name of the ProgressUpdateStream.
migration_task_name(impl Into<String>)/set_migration_task_name(Option<String>):
required: trueUnique identifier that references the migration task. Do not store personal data in this field.
resource_attribute_list(ResourceAttribute)/set_resource_attribute_list(Option<Vec::<ResourceAttribute>>):
required: trueInformation about the resource that is being migrated. This data will be used to map the task to a resource in the Application Discovery Service repository.
Takes the object array of
ResourceAttributewhere theTypefield is reserved for the following values:IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN | VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID | MOTHERBOARD_SERIAL_NUMBERwhere the identifying value can be a string up to 256 characters.-
If any “VM” related value is set for a
ResourceAttributeobject, it is required thatVM_MANAGER_ID, as a minimum, is always set. IfVM_MANAGER_IDis not set, then all “VM” fields will be discarded and “VM” fields will not be used for matching the migration task to a server in Application Discovery Service repository. See the Example section below for a use case of specifying “VM” related values. -
If a server you are trying to match has multiple IP or MAC addresses, you should provide as many as you know in separate type/value pairs passed to the
ResourceAttributeListparameter to maximize the chances of matching.
-
dry_run(bool)/set_dry_run(Option<bool>):
required: falseOptional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.
- On success, responds with
PutResourceAttributesOutput - On failure, responds with
SdkError<PutResourceAttributesError>
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_implconfigured. - Identity caching is enabled without a
sleep_implandtime_sourceconfigured. - No
behavior_versionis 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_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. - This method will panic if no
BehaviorVersionis provided. If you experience this panic, setbehavior_versionon the Config or enable thebehavior-version-latestCargo feature.