Struct aws_sdk_cloudwatch::operation::put_metric_stream::builders::PutMetricStreamFluentBuilder
source · pub struct PutMetricStreamFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to PutMetricStream
.
Creates or updates a metric stream. Metric streams can automatically stream CloudWatch metrics to Amazon Web Services destinations, including Amazon S3, and to many third-party solutions.
For more information, see Using Metric Streams.
To create a metric stream, you must be signed in to an account that has the iam:PassRole
permission and either the CloudWatchFullAccess
policy or the cloudwatch:PutMetricStream
permission.
When you create or update a metric stream, you choose one of the following:
-
Stream metrics from all metric namespaces in the account.
-
Stream metrics from all metric namespaces in the account, except for the namespaces that you list in
ExcludeFilters
. -
Stream metrics from only the metric namespaces that you list in
IncludeFilters
.
By default, a metric stream always sends the MAX
, MIN
, SUM
, and SAMPLECOUNT
statistics for each metric that is streamed. You can use the StatisticsConfigurations
parameter to have the metric stream send additional statistics in the stream. Streaming additional statistics incurs additional costs. For more information, see Amazon CloudWatch Pricing.
When you use PutMetricStream
to create a new metric stream, the stream is created in the running
state. If you use it to update an existing stream, the state of the stream is not changed.
If you are using CloudWatch cross-account observability and you create a metric stream in a monitoring account, you can choose whether to include metrics from source accounts in the stream. For more information, see CloudWatch cross-account observability.
Implementations§
source§impl PutMetricStreamFluentBuilder
impl PutMetricStreamFluentBuilder
sourcepub fn as_input(&self) -> &PutMetricStreamInputBuilder
pub fn as_input(&self) -> &PutMetricStreamInputBuilder
Access the PutMetricStream as a reference.
sourcepub async fn send(
self
) -> Result<PutMetricStreamOutput, SdkError<PutMetricStreamError, HttpResponse>>
pub async fn send( self ) -> Result<PutMetricStreamOutput, SdkError<PutMetricStreamError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self
) -> CustomizableOperation<PutMetricStreamOutput, PutMetricStreamError, Self>
pub fn customize( self ) -> CustomizableOperation<PutMetricStreamOutput, PutMetricStreamError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn name(self, input: impl Into<String>) -> Self
pub fn name(self, input: impl Into<String>) -> Self
If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.
If you are updating a metric stream, specify the name of that stream here.
Valid characters are A-Z, a-z, 0-9, "-" and "_".
sourcepub fn set_name(self, input: Option<String>) -> Self
pub fn set_name(self, input: Option<String>) -> Self
If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.
If you are updating a metric stream, specify the name of that stream here.
Valid characters are A-Z, a-z, 0-9, "-" and "_".
sourcepub fn get_name(&self) -> &Option<String>
pub fn get_name(&self) -> &Option<String>
If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.
If you are updating a metric stream, specify the name of that stream here.
Valid characters are A-Z, a-z, 0-9, "-" and "_".
sourcepub fn include_filters(self, input: MetricStreamFilter) -> Self
pub fn include_filters(self, input: MetricStreamFilter) -> Self
Appends an item to IncludeFilters
.
To override the contents of this collection use set_include_filters
.
If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.
You cannot include IncludeFilters
and ExcludeFilters
in the same operation.
sourcepub fn set_include_filters(self, input: Option<Vec<MetricStreamFilter>>) -> Self
pub fn set_include_filters(self, input: Option<Vec<MetricStreamFilter>>) -> Self
If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.
You cannot include IncludeFilters
and ExcludeFilters
in the same operation.
sourcepub fn get_include_filters(&self) -> &Option<Vec<MetricStreamFilter>>
pub fn get_include_filters(&self) -> &Option<Vec<MetricStreamFilter>>
If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.
You cannot include IncludeFilters
and ExcludeFilters
in the same operation.
sourcepub fn exclude_filters(self, input: MetricStreamFilter) -> Self
pub fn exclude_filters(self, input: MetricStreamFilter) -> Self
Appends an item to ExcludeFilters
.
To override the contents of this collection use set_exclude_filters
.
If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.
You cannot include ExcludeFilters
and IncludeFilters
in the same operation.
sourcepub fn set_exclude_filters(self, input: Option<Vec<MetricStreamFilter>>) -> Self
pub fn set_exclude_filters(self, input: Option<Vec<MetricStreamFilter>>) -> Self
If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.
You cannot include ExcludeFilters
and IncludeFilters
in the same operation.
sourcepub fn get_exclude_filters(&self) -> &Option<Vec<MetricStreamFilter>>
pub fn get_exclude_filters(&self) -> &Option<Vec<MetricStreamFilter>>
If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.
You cannot include ExcludeFilters
and IncludeFilters
in the same operation.
sourcepub fn firehose_arn(self, input: impl Into<String>) -> Self
pub fn firehose_arn(self, input: impl Into<String>) -> Self
The ARN of the Amazon Kinesis Data Firehose delivery stream to use for this metric stream. This Amazon Kinesis Data Firehose delivery stream must already exist and must be in the same account as the metric stream.
sourcepub fn set_firehose_arn(self, input: Option<String>) -> Self
pub fn set_firehose_arn(self, input: Option<String>) -> Self
The ARN of the Amazon Kinesis Data Firehose delivery stream to use for this metric stream. This Amazon Kinesis Data Firehose delivery stream must already exist and must be in the same account as the metric stream.
sourcepub fn get_firehose_arn(&self) -> &Option<String>
pub fn get_firehose_arn(&self) -> &Option<String>
The ARN of the Amazon Kinesis Data Firehose delivery stream to use for this metric stream. This Amazon Kinesis Data Firehose delivery stream must already exist and must be in the same account as the metric stream.
sourcepub fn role_arn(self, input: impl Into<String>) -> Self
pub fn role_arn(self, input: impl Into<String>) -> Self
The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Data Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions:
-
firehose:PutRecord
-
firehose:PutRecordBatch
sourcepub fn set_role_arn(self, input: Option<String>) -> Self
pub fn set_role_arn(self, input: Option<String>) -> Self
The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Data Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions:
-
firehose:PutRecord
-
firehose:PutRecordBatch
sourcepub fn get_role_arn(&self) -> &Option<String>
pub fn get_role_arn(&self) -> &Option<String>
The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Data Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions:
-
firehose:PutRecord
-
firehose:PutRecordBatch
sourcepub fn output_format(self, input: MetricStreamOutputFormat) -> Self
pub fn output_format(self, input: MetricStreamOutputFormat) -> Self
The output format for the stream. Valid values are json
, opentelemetry1.0
, and opentelemetry0.7
. For more information about metric stream output formats, see Metric streams output formats.
sourcepub fn set_output_format(self, input: Option<MetricStreamOutputFormat>) -> Self
pub fn set_output_format(self, input: Option<MetricStreamOutputFormat>) -> Self
The output format for the stream. Valid values are json
, opentelemetry1.0
, and opentelemetry0.7
. For more information about metric stream output formats, see Metric streams output formats.
sourcepub fn get_output_format(&self) -> &Option<MetricStreamOutputFormat>
pub fn get_output_format(&self) -> &Option<MetricStreamOutputFormat>
The output format for the stream. Valid values are json
, opentelemetry1.0
, and opentelemetry0.7
. For more information about metric stream output formats, see Metric streams output formats.
Appends an item to Tags
.
To override the contents of this collection use set_tags
.
A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream.
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.
You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use TagResource or UntagResource.
A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream.
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.
You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use TagResource or UntagResource.
A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream.
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.
You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use TagResource or UntagResource.
sourcepub fn statistics_configurations(
self,
input: MetricStreamStatisticsConfiguration
) -> Self
pub fn statistics_configurations( self, input: MetricStreamStatisticsConfiguration ) -> Self
Appends an item to StatisticsConfigurations
.
To override the contents of this collection use set_statistics_configurations
.
By default, a metric stream always sends the MAX
, MIN
, SUM
, and SAMPLECOUNT
statistics for each metric that is streamed. You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.
For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's OutputFormat
. If the OutputFormat
is json
, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat
is opentelemetry1.0
or opentelemetry0.7
, you can stream percentile statistics such as p95, p99.9, and so on.
sourcepub fn set_statistics_configurations(
self,
input: Option<Vec<MetricStreamStatisticsConfiguration>>
) -> Self
pub fn set_statistics_configurations( self, input: Option<Vec<MetricStreamStatisticsConfiguration>> ) -> Self
By default, a metric stream always sends the MAX
, MIN
, SUM
, and SAMPLECOUNT
statistics for each metric that is streamed. You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.
For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's OutputFormat
. If the OutputFormat
is json
, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat
is opentelemetry1.0
or opentelemetry0.7
, you can stream percentile statistics such as p95, p99.9, and so on.
sourcepub fn get_statistics_configurations(
&self
) -> &Option<Vec<MetricStreamStatisticsConfiguration>>
pub fn get_statistics_configurations( &self ) -> &Option<Vec<MetricStreamStatisticsConfiguration>>
By default, a metric stream always sends the MAX
, MIN
, SUM
, and SAMPLECOUNT
statistics for each metric that is streamed. You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.
For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's OutputFormat
. If the OutputFormat
is json
, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat
is opentelemetry1.0
or opentelemetry0.7
, you can stream percentile statistics such as p95, p99.9, and so on.
sourcepub fn include_linked_accounts_metrics(self, input: bool) -> Self
pub fn include_linked_accounts_metrics(self, input: bool) -> Self
If you are creating a metric stream in a monitoring account, specify true
to include metrics from source accounts in the metric stream.
sourcepub fn set_include_linked_accounts_metrics(self, input: Option<bool>) -> Self
pub fn set_include_linked_accounts_metrics(self, input: Option<bool>) -> Self
If you are creating a metric stream in a monitoring account, specify true
to include metrics from source accounts in the metric stream.
sourcepub fn get_include_linked_accounts_metrics(&self) -> &Option<bool>
pub fn get_include_linked_accounts_metrics(&self) -> &Option<bool>
If you are creating a metric stream in a monitoring account, specify true
to include metrics from source accounts in the metric stream.
Trait Implementations§
source§impl Clone for PutMetricStreamFluentBuilder
impl Clone for PutMetricStreamFluentBuilder
source§fn clone(&self) -> PutMetricStreamFluentBuilder
fn clone(&self) -> PutMetricStreamFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for PutMetricStreamFluentBuilder
impl !RefUnwindSafe for PutMetricStreamFluentBuilder
impl Send for PutMetricStreamFluentBuilder
impl Sync for PutMetricStreamFluentBuilder
impl Unpin for PutMetricStreamFluentBuilder
impl !UnwindSafe for PutMetricStreamFluentBuilder
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> 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 more