Struct aws_sdk_rum::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for CloudWatch RUM
Client for invoking operations on CloudWatch RUM. Each operation on CloudWatch RUM 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_rum::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_rum::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 batch_create_rum_metric_definitions(
&self
) -> BatchCreateRumMetricDefinitionsFluentBuilder
pub fn batch_create_rum_metric_definitions( &self ) -> BatchCreateRumMetricDefinitionsFluentBuilder
Constructs a fluent builder for the BatchCreateRumMetricDefinitions
operation.
- The fluent builder is configurable:
app_monitor_name(impl Into<String>)
/set_app_monitor_name(Option<String>)
:The name of the CloudWatch RUM app monitor that is to send the metrics.
destination(MetricDestination)
/set_destination(Option<MetricDestination>)
:The destination to send the metrics to. Valid values are
CloudWatch
andEvidently
. If you specifyEvidently
, you must also specify the ARN of the CloudWatchEvidently experiment that will receive the metrics and an IAM role that has permission to write to the experiment.destination_arn(impl Into<String>)
/set_destination_arn(Option<String>)
:This parameter is required if
Destination
isEvidently
. IfDestination
isCloudWatch
, do not use this parameter.This parameter specifies the ARN of the Evidently experiment that is to receive the metrics. You must have already defined this experiment as a valid destination. For more information, see PutRumMetricsDestination.
metric_definitions(MetricDefinitionRequest)
/set_metric_definitions(Option<Vec<MetricDefinitionRequest>>)
:An array of structures which define the metrics that you want to send.
- On success, responds with
BatchCreateRumMetricDefinitionsOutput
with field(s):errors(Option<Vec<BatchCreateRumMetricDefinitionsError>>)
:An array of error objects, if the operation caused any errors.
metric_definitions(Option<Vec<MetricDefinition>>)
:An array of structures that define the extended metrics.
- On failure, responds with
SdkError<BatchCreateRumMetricDefinitionsError>
source§impl Client
impl Client
sourcepub fn batch_delete_rum_metric_definitions(
&self
) -> BatchDeleteRumMetricDefinitionsFluentBuilder
pub fn batch_delete_rum_metric_definitions( &self ) -> BatchDeleteRumMetricDefinitionsFluentBuilder
Constructs a fluent builder for the BatchDeleteRumMetricDefinitions
operation.
- The fluent builder is configurable:
app_monitor_name(impl Into<String>)
/set_app_monitor_name(Option<String>)
:The name of the CloudWatch RUM app monitor that is sending these metrics.
destination(MetricDestination)
/set_destination(Option<MetricDestination>)
:Defines the destination where you want to stop sending the specified metrics. Valid values are
CloudWatch
andEvidently
. If you specifyEvidently
, you must also specify the ARN of the CloudWatchEvidently experiment that is to be the destination and an IAM role that has permission to write to the experiment.destination_arn(impl Into<String>)
/set_destination_arn(Option<String>)
:This parameter is required if
Destination
isEvidently
. IfDestination
isCloudWatch
, do not use this parameter.This parameter specifies the ARN of the Evidently experiment that was receiving the metrics that are being deleted.
metric_definition_ids(impl Into<String>)
/set_metric_definition_ids(Option<Vec<String>>)
:An array of structures which define the metrics that you want to stop sending.
- On success, responds with
BatchDeleteRumMetricDefinitionsOutput
with field(s):errors(Option<Vec<BatchDeleteRumMetricDefinitionsError>>)
:An array of error objects, if the operation caused any errors.
metric_definition_ids(Option<Vec<String>>)
:The IDs of the metric definitions that were deleted.
- On failure, responds with
SdkError<BatchDeleteRumMetricDefinitionsError>
source§impl Client
impl Client
sourcepub fn batch_get_rum_metric_definitions(
&self
) -> BatchGetRumMetricDefinitionsFluentBuilder
pub fn batch_get_rum_metric_definitions( &self ) -> BatchGetRumMetricDefinitionsFluentBuilder
Constructs a fluent builder for the BatchGetRumMetricDefinitions
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
app_monitor_name(impl Into<String>)
/set_app_monitor_name(Option<String>)
:The name of the CloudWatch RUM app monitor that is sending the metrics.
destination(MetricDestination)
/set_destination(Option<MetricDestination>)
:The type of destination that you want to view metrics for. Valid values are
CloudWatch
andEvidently
.destination_arn(impl Into<String>)
/set_destination_arn(Option<String>)
:This parameter is required if
Destination
isEvidently
. IfDestination
isCloudWatch
, do not use this parameter.This parameter specifies the ARN of the Evidently experiment that corresponds to the destination.
max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of results to return in one operation. The default is 50. The maximum that you can specify is 100.
To retrieve the remaining results, make another call with the returned
NextToken
value.next_token(impl Into<String>)
/set_next_token(Option<String>)
:Use the token returned by the previous operation to request the next page of results.
- On success, responds with
BatchGetRumMetricDefinitionsOutput
with field(s):metric_definitions(Option<Vec<MetricDefinition>>)
:An array of structures that display information about the metrics that are sent by the specified app monitor to the specified destination.
next_token(Option<String>)
:A token that you can use in a subsequent operation to retrieve the next set of results.
- On failure, responds with
SdkError<BatchGetRumMetricDefinitionsError>
source§impl Client
impl Client
sourcepub fn create_app_monitor(&self) -> CreateAppMonitorFluentBuilder
pub fn create_app_monitor(&self) -> CreateAppMonitorFluentBuilder
Constructs a fluent builder for the CreateAppMonitor
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:A name for the app monitor.
domain(impl Into<String>)
/set_domain(Option<String>)
:The top-level internet domain name for which your application has administrative authority.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap<String, String>>)
:Assigns one or more tags (key-value pairs) to the app monitor.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
Tags don’t have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.
You can associate as many as 50 tags with an app monitor.
For more information, see Tagging Amazon Web Services resources.
app_monitor_configuration(AppMonitorConfiguration)
/set_app_monitor_configuration(Option<AppMonitorConfiguration>)
:A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don’t include
AppMonitorConfiguration
, you must set up your own authorization method. For more information, see Authorize your application to send data to Amazon Web Services.If you omit this argument, the sample rate used for RUM is set to 10% of the user sessions.
cw_log_enabled(bool)
/set_cw_log_enabled(Option<bool>)
:Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.
If you omit this parameter, the default is
false
.custom_events(CustomEvents)
/set_custom_events(Option<CustomEvents>)
:Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are
DISABLED
.For more information about custom events, see Send custom events.
- On success, responds with
CreateAppMonitorOutput
with field(s):id(Option<String>)
:The unique ID of the new app monitor.
- On failure, responds with
SdkError<CreateAppMonitorError>
source§impl Client
impl Client
sourcepub fn delete_app_monitor(&self) -> DeleteAppMonitorFluentBuilder
pub fn delete_app_monitor(&self) -> DeleteAppMonitorFluentBuilder
Constructs a fluent builder for the DeleteAppMonitor
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the app monitor to delete.
- On success, responds with
DeleteAppMonitorOutput
- On failure, responds with
SdkError<DeleteAppMonitorError>
source§impl Client
impl Client
sourcepub fn delete_rum_metrics_destination(
&self
) -> DeleteRumMetricsDestinationFluentBuilder
pub fn delete_rum_metrics_destination( &self ) -> DeleteRumMetricsDestinationFluentBuilder
Constructs a fluent builder for the DeleteRumMetricsDestination
operation.
- The fluent builder is configurable:
app_monitor_name(impl Into<String>)
/set_app_monitor_name(Option<String>)
:The name of the app monitor that is sending metrics to the destination that you want to delete.
destination(MetricDestination)
/set_destination(Option<MetricDestination>)
:The type of destination to delete. Valid values are
CloudWatch
andEvidently
.destination_arn(impl Into<String>)
/set_destination_arn(Option<String>)
:This parameter is required if
Destination
isEvidently
. IfDestination
isCloudWatch
, do not use this parameter. This parameter specifies the ARN of the Evidently experiment that corresponds to the destination to delete.
- On success, responds with
DeleteRumMetricsDestinationOutput
- On failure, responds with
SdkError<DeleteRumMetricsDestinationError>
source§impl Client
impl Client
sourcepub fn get_app_monitor(&self) -> GetAppMonitorFluentBuilder
pub fn get_app_monitor(&self) -> GetAppMonitorFluentBuilder
Constructs a fluent builder for the GetAppMonitor
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The app monitor to retrieve information for.
- On success, responds with
GetAppMonitorOutput
with field(s):app_monitor(Option<AppMonitor>)
:A structure containing all the configuration information for the app monitor.
- On failure, responds with
SdkError<GetAppMonitorError>
source§impl Client
impl Client
sourcepub fn get_app_monitor_data(&self) -> GetAppMonitorDataFluentBuilder
pub fn get_app_monitor_data(&self) -> GetAppMonitorDataFluentBuilder
Constructs a fluent builder for the GetAppMonitorData
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the app monitor that collected the data that you want to retrieve.
time_range(TimeRange)
/set_time_range(Option<TimeRange>)
:A structure that defines the time range that you want to retrieve results from.
filters(QueryFilter)
/set_filters(Option<Vec<QueryFilter>>)
:An array of structures that you can use to filter the results to those that match one or more sets of key-value pairs that you specify.
max_results(i32)
/set_max_results(i32)
:The maximum number of results to return in one operation.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:Use the token returned by the previous operation to request the next page of results.
- On success, responds with
GetAppMonitorDataOutput
with field(s):events(Option<Vec<String>>)
:The events that RUM collected that match your request.
next_token(Option<String>)
:A token that you can use in a subsequent operation to retrieve the next set of results.
- On failure, responds with
SdkError<GetAppMonitorDataError>
source§impl Client
impl Client
sourcepub fn list_app_monitors(&self) -> ListAppMonitorsFluentBuilder
pub fn list_app_monitors(&self) -> ListAppMonitorsFluentBuilder
Constructs a fluent builder for the ListAppMonitors
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of results to return in one operation. The default is 50. The maximum that you can specify is 100.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:Use the token returned by the previous operation to request the next page of results.
- On success, responds with
ListAppMonitorsOutput
with field(s):next_token(Option<String>)
:A token that you can use in a subsequent operation to retrieve the next set of results.
app_monitor_summaries(Option<Vec<AppMonitorSummary>>)
:An array of structures that contain information about the returned app monitors.
- On failure, responds with
SdkError<ListAppMonitorsError>
source§impl Client
impl Client
sourcepub fn list_rum_metrics_destinations(
&self
) -> ListRumMetricsDestinationsFluentBuilder
pub fn list_rum_metrics_destinations( &self ) -> ListRumMetricsDestinationsFluentBuilder
Constructs a fluent builder for the ListRumMetricsDestinations
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
app_monitor_name(impl Into<String>)
/set_app_monitor_name(Option<String>)
:The name of the app monitor associated with the destinations that you want to retrieve.
max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of results to return in one operation. The default is 50. The maximum that you can specify is 100.
To retrieve the remaining results, make another call with the returned
NextToken
value.next_token(impl Into<String>)
/set_next_token(Option<String>)
:Use the token returned by the previous operation to request the next page of results.
- On success, responds with
ListRumMetricsDestinationsOutput
with field(s):destinations(Option<Vec<MetricDestinationSummary>>)
:The list of CloudWatch RUM extended metrics destinations associated with the app monitor that you specified.
next_token(Option<String>)
:A token that you can use in a subsequent operation to retrieve the next set of results.
- On failure, responds with
SdkError<ListRumMetricsDestinationsError>
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 ARN of the resource that you want to see the tags of.
- On success, responds with
ListTagsForResourceOutput
with field(s):resource_arn(Option<String>)
:The ARN of the resource that you are viewing.
tags(Option<HashMap<String, String>>)
:The list of tag keys and values associated with the resource you specified.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn put_rum_events(&self) -> PutRumEventsFluentBuilder
pub fn put_rum_events(&self) -> PutRumEventsFluentBuilder
Constructs a fluent builder for the PutRumEvents
operation.
- The fluent builder is configurable:
id(impl Into<String>)
/set_id(Option<String>)
:The ID of the app monitor that is sending this data.
batch_id(impl Into<String>)
/set_batch_id(Option<String>)
:A unique identifier for this batch of RUM event data.
app_monitor_details(AppMonitorDetails)
/set_app_monitor_details(Option<AppMonitorDetails>)
:A structure that contains information about the app monitor that collected this telemetry information.
user_details(UserDetails)
/set_user_details(Option<UserDetails>)
:A structure that contains information about the user session that this batch of events was collected from.
rum_events(RumEvent)
/set_rum_events(Option<Vec<RumEvent>>)
:An array of structures that contain the telemetry event data.
- On success, responds with
PutRumEventsOutput
- On failure, responds with
SdkError<PutRumEventsError>
source§impl Client
impl Client
sourcepub fn put_rum_metrics_destination(
&self
) -> PutRumMetricsDestinationFluentBuilder
pub fn put_rum_metrics_destination( &self ) -> PutRumMetricsDestinationFluentBuilder
Constructs a fluent builder for the PutRumMetricsDestination
operation.
- The fluent builder is configurable:
app_monitor_name(impl Into<String>)
/set_app_monitor_name(Option<String>)
:The name of the CloudWatch RUM app monitor that will send the metrics.
destination(MetricDestination)
/set_destination(Option<MetricDestination>)
:Defines the destination to send the metrics to. Valid values are
CloudWatch
andEvidently
. If you specifyEvidently
, you must also specify the ARN of the CloudWatchEvidently experiment that is to be the destination and an IAM role that has permission to write to the experiment.destination_arn(impl Into<String>)
/set_destination_arn(Option<String>)
:Use this parameter only if
Destination
isEvidently
. This parameter specifies the ARN of the Evidently experiment that will receive the extended metrics.iam_role_arn(impl Into<String>)
/set_iam_role_arn(Option<String>)
:This parameter is required if
Destination
isEvidently
. IfDestination
isCloudWatch
, do not use this parameter.This parameter specifies the ARN of an IAM role that RUM will assume to write to the Evidently experiment that you are sending metrics to. This role must have permission to write to that experiment.
- On success, responds with
PutRumMetricsDestinationOutput
- On failure, responds with
SdkError<PutRumMetricsDestinationError>
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 ARN of the CloudWatch RUM resource that you’re adding tags to.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap<String, String>>)
:The list of key-value pairs to associate with the resource.
- 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 ARN of the CloudWatch RUM resource that you’re removing tags from.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec<String>>)
:The list of tag keys to remove from the resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_app_monitor(&self) -> UpdateAppMonitorFluentBuilder
pub fn update_app_monitor(&self) -> UpdateAppMonitorFluentBuilder
Constructs a fluent builder for the UpdateAppMonitor
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the app monitor to update.
domain(impl Into<String>)
/set_domain(Option<String>)
:The top-level internet domain name for which your application has administrative authority.
app_monitor_configuration(AppMonitorConfiguration)
/set_app_monitor_configuration(Option<AppMonitorConfiguration>)
:A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don’t include
AppMonitorConfiguration
, you must set up your own authorization method. For more information, see Authorize your application to send data to Amazon Web Services.cw_log_enabled(bool)
/set_cw_log_enabled(Option<bool>)
:Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.
custom_events(CustomEvents)
/set_custom_events(Option<CustomEvents>)
:Specifies whether this app monitor allows the web client to define and send custom events. The default is for custom events to be
DISABLED
.For more information about custom events, see Send custom events.
- On success, responds with
UpdateAppMonitorOutput
- On failure, responds with
SdkError<UpdateAppMonitorError>
source§impl Client
impl Client
sourcepub fn update_rum_metric_definition(
&self
) -> UpdateRumMetricDefinitionFluentBuilder
pub fn update_rum_metric_definition( &self ) -> UpdateRumMetricDefinitionFluentBuilder
Constructs a fluent builder for the UpdateRumMetricDefinition
operation.
- The fluent builder is configurable:
app_monitor_name(impl Into<String>)
/set_app_monitor_name(Option<String>)
:The name of the CloudWatch RUM app monitor that sends these metrics.
destination(MetricDestination)
/set_destination(Option<MetricDestination>)
:The destination to send the metrics to. Valid values are
CloudWatch
andEvidently
. If you specifyEvidently
, you must also specify the ARN of the CloudWatchEvidently experiment that will receive the metrics and an IAM role that has permission to write to the experiment.destination_arn(impl Into<String>)
/set_destination_arn(Option<String>)
:This parameter is required if
Destination
isEvidently
. IfDestination
isCloudWatch
, do not use this parameter.This parameter specifies the ARN of the Evidently experiment that is to receive the metrics. You must have already defined this experiment as a valid destination. For more information, see PutRumMetricsDestination.
metric_definition(MetricDefinitionRequest)
/set_metric_definition(Option<MetricDefinitionRequest>)
:A structure that contains the new definition that you want to use for this metric.
metric_definition_id(impl Into<String>)
/set_metric_definition_id(Option<String>)
:The ID of the metric definition to update.
- On success, responds with
UpdateRumMetricDefinitionOutput
- On failure, responds with
SdkError<UpdateRumMetricDefinitionError>
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.