Struct aws_sdk_internetmonitor::Client
source · pub struct Client { /* private fields */ }Expand description
Client for Amazon CloudWatch Internet Monitor
Client for invoking operations on Amazon CloudWatch Internet Monitor. Each operation on Amazon CloudWatch Internet Monitor 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_internetmonitor::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_internetmonitor::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 ListTagsForResource operation has
a Client::list_tags_for_resource, 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.list_tags_for_resource()
.resource_arn("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 create_monitor(&self) -> CreateMonitorFluentBuilder
pub fn create_monitor(&self) -> CreateMonitorFluentBuilder
Constructs a fluent builder for the CreateMonitor operation.
- The fluent builder is configurable:
monitor_name(impl Into<String>)/set_monitor_name(Option<String>):The name of the monitor.
resources(impl Into<String>)/set_resources(Option<Vec<String>>):The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront distributions, or Amazon WorkSpaces directories.
You can add a combination of VPCs and CloudFront distributions, or you can add WorkSpaces directories, or you can add NLBs. You can’t add NLBs or WorkSpaces directories together with any other resources.
If you add only Amazon VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.
client_token(impl Into<String>)/set_client_token(Option<String>):A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don’t reuse the same client token for other API requests.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap<String, String>>):The tags for a monitor. You can add a maximum of 50 tags in Internet Monitor.
max_city_networks_to_monitor(i32)/set_max_city_networks_to_monitor(i32):The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the ASN or network provider, such as an internet service provider (ISP), that clients access the resources through. Setting this limit can help control billing costs.
To learn more, see Choosing a city-network maximum value in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.
internet_measurements_log_delivery(InternetMeasurementsLogDelivery)/set_internet_measurements_log_delivery(Option<InternetMeasurementsLogDelivery>):Publish internet measurements for Internet Monitor to an Amazon S3 bucket in addition to CloudWatch Logs.
traffic_percentage_to_monitor(i32)/set_traffic_percentage_to_monitor(i32):The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. If you set a city-networks maximum, that limit overrides the traffic percentage that you set.
To learn more, see Choosing an application traffic percentage to monitor in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.
health_events_config(HealthEventsConfig)/set_health_events_config(Option<HealthEventsConfig>):Defines the threshold percentages and other configuration information for when Amazon CloudWatch Internet Monitor creates a health event. Internet Monitor creates a health event when an internet issue that affects your application end users has a health score percentage that is at or below a specific threshold, and, sometimes, when other criteria are met.
If you don’t set a health event threshold, the default value is 95%.
For more information, see Change health event thresholds in the Internet Monitor section of the CloudWatch User Guide.
- On success, responds with
CreateMonitorOutputwith field(s):arn(Option<String>):The Amazon Resource Name (ARN) of the monitor.
status(Option<MonitorConfigState>):The status of a monitor.
- On failure, responds with
SdkError<CreateMonitorError>
source§impl Client
impl Client
sourcepub fn delete_monitor(&self) -> DeleteMonitorFluentBuilder
pub fn delete_monitor(&self) -> DeleteMonitorFluentBuilder
Constructs a fluent builder for the DeleteMonitor operation.
- The fluent builder is configurable:
monitor_name(impl Into<String>)/set_monitor_name(Option<String>):The name of the monitor to delete.
- On success, responds with
DeleteMonitorOutput - On failure, responds with
SdkError<DeleteMonitorError>
source§impl Client
impl Client
sourcepub fn get_health_event(&self) -> GetHealthEventFluentBuilder
pub fn get_health_event(&self) -> GetHealthEventFluentBuilder
Constructs a fluent builder for the GetHealthEvent operation.
- The fluent builder is configurable:
monitor_name(impl Into<String>)/set_monitor_name(Option<String>):The name of the monitor.
event_id(impl Into<String>)/set_event_id(Option<String>):The internally generated identifier of a health event. Because
EventIDcontains the forward slash (“/”) character, you must URL-encode theEventIDfield in the request URL.
- On success, responds with
GetHealthEventOutputwith field(s):event_arn(Option<String>):The Amazon Resource Name (ARN) of the event.
event_id(Option<String>):The internally generated identifier of a health event.
started_at(Option<DateTime>):The time when a health event started.
ended_at(Option<DateTime>):The time when a health event was resolved. If the health event is still active, the end time is not set.
created_at(Option<DateTime>):The time when a health event was created.
last_updated_at(Option<DateTime>):The time when a health event was last updated or recalculated.
impacted_locations(Option<Vec<ImpactedLocation>>):The locations affected by a health event.
status(Option<HealthEventStatus>):The status of a health event.
percent_of_total_traffic_impacted(Option<f64>):The impact on total traffic that a health event has, in increased latency or reduced availability. This is the percentage of how much latency has increased or availability has decreased during the event, compared to what is typical for traffic from this client location to the Amazon Web Services location using this client network.
impact_type(Option<HealthEventImpactType>):The type of impairment of a specific health event.
health_score_threshold(f64):The threshold percentage for a health score that determines, along with other configuration information, when Internet Monitor creates a health event when there’s an internet issue that affects your application end users.
- On failure, responds with
SdkError<GetHealthEventError>
source§impl Client
impl Client
sourcepub fn get_monitor(&self) -> GetMonitorFluentBuilder
pub fn get_monitor(&self) -> GetMonitorFluentBuilder
Constructs a fluent builder for the GetMonitor operation.
- The fluent builder is configurable:
monitor_name(impl Into<String>)/set_monitor_name(Option<String>):The name of the monitor.
- On success, responds with
GetMonitorOutputwith field(s):monitor_name(Option<String>):The name of the monitor.
monitor_arn(Option<String>):The Amazon Resource Name (ARN) of the monitor.
resources(Option<Vec<String>>):The resources monitored by the monitor. Resources are listed by their Amazon Resource Names (ARNs).
status(Option<MonitorConfigState>):The status of the monitor.
created_at(Option<DateTime>):The time when the monitor was created.
modified_at(Option<DateTime>):The last time that the monitor was modified.
processing_status(Option<MonitorProcessingStatusCode>):The health of the data processing for the monitor.
processing_status_info(Option<String>):Additional information about the health of the data processing for the monitor.
tags(Option<HashMap<String, String>>):The tags that have been added to monitor.
max_city_networks_to_monitor(i32):The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the ASN or network provider, such as an internet service provider (ISP), that clients access the resources through. This limit can help control billing costs.
To learn more, see Choosing a city-network maximum value in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.
internet_measurements_log_delivery(Option<InternetMeasurementsLogDelivery>):Publish internet measurements for Internet Monitor to another location, such as an Amazon S3 bucket. The measurements are also published to Amazon CloudWatch Logs.
traffic_percentage_to_monitor(i32):The percentage of the internet-facing traffic for your application to monitor with this monitor. If you set a city-networks maximum, that limit overrides the traffic percentage that you set.
To learn more, see Choosing an application traffic percentage to monitor in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.
health_events_config(Option<HealthEventsConfig>):The list of health event threshold configurations. The threshold percentage for a health score determines, along with other configuration information, when Internet Monitor creates a health event when there’s an internet issue that affects your application end users.
For more information, see Change health event thresholds in the Internet Monitor section of the CloudWatch User Guide.
- On failure, responds with
SdkError<GetMonitorError>
source§impl Client
impl Client
sourcepub fn list_health_events(&self) -> ListHealthEventsFluentBuilder
pub fn list_health_events(&self) -> ListHealthEventsFluentBuilder
Constructs a fluent builder for the ListHealthEvents operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
monitor_name(impl Into<String>)/set_monitor_name(Option<String>):The name of the monitor.
start_time(DateTime)/set_start_time(Option<DateTime>):The time when a health event started.
end_time(DateTime)/set_end_time(Option<DateTime>):The time when a health event ended. If the health event is still ongoing, then the end time is not set.
next_token(impl Into<String>)/set_next_token(Option<String>):The token for the next set of results. You receive this token from a previous call.
max_results(i32)/set_max_results(i32):The number of health event objects that you want to return with this call.
event_status(HealthEventStatus)/set_event_status(Option<HealthEventStatus>):The status of a health event.
- On success, responds with
ListHealthEventsOutputwith field(s):health_events(Option<Vec<HealthEvent>>):A list of health events.
next_token(Option<String>):The token for the next set of results. You receive this token from a previous call.
- On failure, responds with
SdkError<ListHealthEventsError>
source§impl Client
impl Client
sourcepub fn list_monitors(&self) -> ListMonitorsFluentBuilder
pub fn list_monitors(&self) -> ListMonitorsFluentBuilder
Constructs a fluent builder for the ListMonitors operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
next_token(impl Into<String>)/set_next_token(Option<String>):The token for the next set of results. You receive this token from a previous call.
max_results(i32)/set_max_results(i32):The number of monitor objects that you want to return with this call.
monitor_status(impl Into<String>)/set_monitor_status(Option<String>):The status of a monitor. This includes the status of the data processing for the monitor and the status of the monitor itself.
For information about the statuses for a monitor, see Monitor.
- On success, responds with
ListMonitorsOutputwith field(s):monitors(Option<Vec<Monitor>>):A list of monitors.
next_token(Option<String>):The token for the next set of results. You receive this token from a previous call.
- On failure, responds with
SdkError<ListMonitorsError>
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) for a resource.
- On success, responds with
ListTagsForResourceOutputwith field(s):tags(Option<HashMap<String, String>>):Tags for a resource.
- 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) for a tag that you add to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.
tags(impl Into<String>, impl Into<String>)/set_tags(Option<HashMap<String, String>>):Tags that you add to a resource. You can add a maximum of 50 tags in Internet Monitor.
- 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) for a tag you remove a resource from.
tag_keys(impl Into<String>)/set_tag_keys(Option<Vec<String>>):Tag keys that you remove from a resource.
- On success, responds with
UntagResourceOutput - On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_monitor(&self) -> UpdateMonitorFluentBuilder
pub fn update_monitor(&self) -> UpdateMonitorFluentBuilder
Constructs a fluent builder for the UpdateMonitor operation.
- The fluent builder is configurable:
monitor_name(impl Into<String>)/set_monitor_name(Option<String>):The name of the monitor.
resources_to_add(impl Into<String>)/set_resources_to_add(Option<Vec<String>>):The resources to include in a monitor, which you provide as a set of Amazon Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront distributions, or Amazon WorkSpaces directories.
You can add a combination of VPCs and CloudFront distributions, or you can add WorkSpaces directories, or you can add NLBs. You can’t add NLBs or WorkSpaces directories together with any other resources.
If you add only Amazon Virtual Private Clouds resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.
resources_to_remove(impl Into<String>)/set_resources_to_remove(Option<Vec<String>>):The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).
status(MonitorConfigState)/set_status(Option<MonitorConfigState>):The status for a monitor. The accepted values for
Statuswith theUpdateMonitorAPI call are the following:ACTIVEandINACTIVE. The following values are not accepted:PENDING, andERROR.client_token(impl Into<String>)/set_client_token(Option<String>):A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. You should not reuse the same client token for other API requests.
max_city_networks_to_monitor(i32)/set_max_city_networks_to_monitor(i32):The maximum number of city-networks to monitor for your application. A city-network is the location (city) where clients access your application resources from and the ASN or network provider, such as an internet service provider (ISP), that clients access the resources through. Setting this limit can help control billing costs.
internet_measurements_log_delivery(InternetMeasurementsLogDelivery)/set_internet_measurements_log_delivery(Option<InternetMeasurementsLogDelivery>):Publish internet measurements for Internet Monitor to another location, such as an Amazon S3 bucket. The measurements are also published to Amazon CloudWatch Logs.
traffic_percentage_to_monitor(i32)/set_traffic_percentage_to_monitor(i32):The percentage of the internet-facing traffic for your application that you want to monitor with this monitor. If you set a city-networks maximum, that limit overrides the traffic percentage that you set.
To learn more, see Choosing an application traffic percentage to monitor in the Amazon CloudWatch Internet Monitor section of the CloudWatch User Guide.
health_events_config(HealthEventsConfig)/set_health_events_config(Option<HealthEventsConfig>):The list of health score thresholds. A threshold percentage for health scores, along with other configuration information, determines when Internet Monitor creates a health event when there’s an internet issue that affects your application end users.
For more information, see Change health event thresholds in the Internet Monitor section of the CloudWatch User Guide.
- On success, responds with
UpdateMonitorOutputwith field(s):monitor_arn(Option<String>):The Amazon Resource Name (ARN) of the monitor.
status(Option<MonitorConfigState>):The status of a monitor.
- On failure, responds with
SdkError<UpdateMonitorError>
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.