Struct aws_sdk_cloudwatchlogs::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
Client for Amazon CloudWatch Logs
Client for invoking operations on Amazon CloudWatch Logs. Each operation on Amazon CloudWatch Logs is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_cloudwatchlogs::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_cloudwatchlogs::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_cloudwatchlogs::Client::from_conf(config);
Implementations
sourceimpl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
sourceimpl Client
impl Client
sourcepub fn associate_kms_key(&self) -> AssociateKmsKey
pub fn associate_kms_key(&self) -> AssociateKmsKey
Constructs a fluent builder for the AssociateKmsKey
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
kms_key_id(impl Into<String>)
/set_kms_key_id(Option<String>)
:The Amazon Resource Name (ARN) of the CMK to use when encrypting log data. This must be a symmetric CMK. For more information, see Amazon Resource Names - Key Management Service and Using Symmetric and Asymmetric Keys.
- On success, responds with
AssociateKmsKeyOutput
- On failure, responds with
SdkError<AssociateKmsKeyError>
sourcepub fn cancel_export_task(&self) -> CancelExportTask
pub fn cancel_export_task(&self) -> CancelExportTask
Constructs a fluent builder for the CancelExportTask
operation.
- The fluent builder is configurable:
task_id(impl Into<String>)
/set_task_id(Option<String>)
:The ID of the export task.
- On success, responds with
CancelExportTaskOutput
- On failure, responds with
SdkError<CancelExportTaskError>
sourcepub fn create_export_task(&self) -> CreateExportTask
pub fn create_export_task(&self) -> CreateExportTask
Constructs a fluent builder for the CreateExportTask
operation.
- The fluent builder is configurable:
task_name(impl Into<String>)
/set_task_name(Option<String>)
:The name of the export task.
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
log_stream_name_prefix(impl Into<String>)
/set_log_stream_name_prefix(Option<String>)
:Export only log streams that match the provided prefix. If you don’t specify a value, no prefix filter is applied.
from(i64)
/set_from(Option<i64>)
:The start time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp earlier than this time are not exported.
to(i64)
/set_to(Option<i64>)
:The end time of the range for the request, expreswatchlogsdocused as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not exported.
destination(impl Into<String>)
/set_destination(Option<String>)
:The name of S3 bucket for the exported log data. The bucket must be in the same Amazon Web Services region.
destination_prefix(impl Into<String>)
/set_destination_prefix(Option<String>)
:The prefix used as the start of the key for every object exported. If you don’t specify a value, the default is
exportedlogs
.
- On success, responds with
CreateExportTaskOutput
with field(s):task_id(Option<String>)
:The ID of the export task.
- On failure, responds with
SdkError<CreateExportTaskError>
sourcepub fn create_log_group(&self) -> CreateLogGroup
pub fn create_log_group(&self) -> CreateLogGroup
Constructs a fluent builder for the CreateLogGroup
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
kms_key_id(impl Into<String>)
/set_kms_key_id(Option<String>)
:The Amazon Resource Name (ARN) of the CMK to use when encrypting log data. For more information, see Amazon Resource Names - Key Management Service.
tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
:The key-value pairs to use for the tags.
CloudWatch Logs doesn’t support IAM policies that prevent users from assigning specified tags to log groups using the
aws:Resource/key-name
oraws:TagKeys
condition keys. For more information about using tags to control access, see Controlling access to Amazon Web Services resources using tags.
- On success, responds with
CreateLogGroupOutput
- On failure, responds with
SdkError<CreateLogGroupError>
sourcepub fn create_log_stream(&self) -> CreateLogStream
pub fn create_log_stream(&self) -> CreateLogStream
Constructs a fluent builder for the CreateLogStream
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
log_stream_name(impl Into<String>)
/set_log_stream_name(Option<String>)
:The name of the log stream.
- On success, responds with
CreateLogStreamOutput
- On failure, responds with
SdkError<CreateLogStreamError>
sourcepub fn delete_destination(&self) -> DeleteDestination
pub fn delete_destination(&self) -> DeleteDestination
Constructs a fluent builder for the DeleteDestination
operation.
- The fluent builder is configurable:
destination_name(impl Into<String>)
/set_destination_name(Option<String>)
:The name of the destination.
- On success, responds with
DeleteDestinationOutput
- On failure, responds with
SdkError<DeleteDestinationError>
sourcepub fn delete_log_group(&self) -> DeleteLogGroup
pub fn delete_log_group(&self) -> DeleteLogGroup
Constructs a fluent builder for the DeleteLogGroup
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
- On success, responds with
DeleteLogGroupOutput
- On failure, responds with
SdkError<DeleteLogGroupError>
sourcepub fn delete_log_stream(&self) -> DeleteLogStream
pub fn delete_log_stream(&self) -> DeleteLogStream
Constructs a fluent builder for the DeleteLogStream
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
log_stream_name(impl Into<String>)
/set_log_stream_name(Option<String>)
:The name of the log stream.
- On success, responds with
DeleteLogStreamOutput
- On failure, responds with
SdkError<DeleteLogStreamError>
sourcepub fn delete_metric_filter(&self) -> DeleteMetricFilter
pub fn delete_metric_filter(&self) -> DeleteMetricFilter
Constructs a fluent builder for the DeleteMetricFilter
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
filter_name(impl Into<String>)
/set_filter_name(Option<String>)
:The name of the metric filter.
- On success, responds with
DeleteMetricFilterOutput
- On failure, responds with
SdkError<DeleteMetricFilterError>
sourcepub fn delete_query_definition(&self) -> DeleteQueryDefinition
pub fn delete_query_definition(&self) -> DeleteQueryDefinition
Constructs a fluent builder for the DeleteQueryDefinition
operation.
- The fluent builder is configurable:
query_definition_id(impl Into<String>)
/set_query_definition_id(Option<String>)
:The ID of the query definition that you want to delete. You can use DescribeQueryDefinitions to retrieve the IDs of your saved query definitions.
- On success, responds with
DeleteQueryDefinitionOutput
with field(s):success(bool)
:A value of TRUE indicates that the operation succeeded. FALSE indicates that the operation failed.
- On failure, responds with
SdkError<DeleteQueryDefinitionError>
sourcepub fn delete_resource_policy(&self) -> DeleteResourcePolicy
pub fn delete_resource_policy(&self) -> DeleteResourcePolicy
Constructs a fluent builder for the DeleteResourcePolicy
operation.
- The fluent builder is configurable:
policy_name(impl Into<String>)
/set_policy_name(Option<String>)
:The name of the policy to be revoked. This parameter is required.
- On success, responds with
DeleteResourcePolicyOutput
- On failure, responds with
SdkError<DeleteResourcePolicyError>
sourcepub fn delete_retention_policy(&self) -> DeleteRetentionPolicy
pub fn delete_retention_policy(&self) -> DeleteRetentionPolicy
Constructs a fluent builder for the DeleteRetentionPolicy
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
- On success, responds with
DeleteRetentionPolicyOutput
- On failure, responds with
SdkError<DeleteRetentionPolicyError>
sourcepub fn delete_subscription_filter(&self) -> DeleteSubscriptionFilter
pub fn delete_subscription_filter(&self) -> DeleteSubscriptionFilter
Constructs a fluent builder for the DeleteSubscriptionFilter
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
filter_name(impl Into<String>)
/set_filter_name(Option<String>)
:The name of the subscription filter.
- On success, responds with
DeleteSubscriptionFilterOutput
- On failure, responds with
SdkError<DeleteSubscriptionFilterError>
sourcepub fn describe_destinations(&self) -> DescribeDestinations
pub fn describe_destinations(&self) -> DescribeDestinations
Constructs a fluent builder for the DescribeDestinations
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
destination_name_prefix(impl Into<String>)
/set_destination_name_prefix(Option<String>)
:The prefix to match. If you don’t specify a value, no prefix filter is applied.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. (You received this token from a previous call.)
limit(i32)
/set_limit(Option<i32>)
:The maximum number of items returned. If you don’t specify a value, the default is up to 50 items.
- On success, responds with
DescribeDestinationsOutput
with field(s):destinations(Option<Vec<Destination>>)
:The destinations.
next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeDestinationsError>
sourcepub fn describe_export_tasks(&self) -> DescribeExportTasks
pub fn describe_export_tasks(&self) -> DescribeExportTasks
Constructs a fluent builder for the DescribeExportTasks
operation.
- The fluent builder is configurable:
task_id(impl Into<String>)
/set_task_id(Option<String>)
:The ID of the export task. Specifying a task ID filters the results to zero or one export tasks.
status_code(ExportTaskStatusCode)
/set_status_code(Option<ExportTaskStatusCode>)
:The status code of the export task. Specifying a status code filters the results to zero or more export tasks.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. (You received this token from a previous call.)
limit(i32)
/set_limit(Option<i32>)
:The maximum number of items returned. If you don’t specify a value, the default is up to 50 items.
- On success, responds with
DescribeExportTasksOutput
with field(s):export_tasks(Option<Vec<ExportTask>>)
:The export tasks.
next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeExportTasksError>
sourcepub fn describe_log_groups(&self) -> DescribeLogGroups
pub fn describe_log_groups(&self) -> DescribeLogGroups
Constructs a fluent builder for the DescribeLogGroups
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
log_group_name_prefix(impl Into<String>)
/set_log_group_name_prefix(Option<String>)
:The prefix to match.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. (You received this token from a previous call.)
limit(i32)
/set_limit(Option<i32>)
:The maximum number of items returned. If you don’t specify a value, the default is up to 50 items.
- On success, responds with
DescribeLogGroupsOutput
with field(s):log_groups(Option<Vec<LogGroup>>)
:The log groups.
If the
retentionInDays
value if not included for a log group, then that log group is set to have its events never expire.next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeLogGroupsError>
sourcepub fn describe_log_streams(&self) -> DescribeLogStreams
pub fn describe_log_streams(&self) -> DescribeLogStreams
Constructs a fluent builder for the DescribeLogStreams
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
log_stream_name_prefix(impl Into<String>)
/set_log_stream_name_prefix(Option<String>)
:The prefix to match.
If
orderBy
isLastEventTime
, you cannot specify this parameter.order_by(OrderBy)
/set_order_by(Option<OrderBy>)
:If the value is
LogStreamName
, the results are ordered by log stream name. If the value isLastEventTime
, the results are ordered by the event time. The default value isLogStreamName
.If you order the results by event time, you cannot specify the
logStreamNamePrefix
parameter.lastEventTimestamp
represents the time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.lastEventTimestamp
updates on an eventual consistency basis. It typically updates in less than an hour from ingestion, but in rare situations might take longer.descending(bool)
/set_descending(Option<bool>)
:If the value is true, results are returned in descending order. If the value is to false, results are returned in ascending order. The default value is false.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. (You received this token from a previous call.)
limit(i32)
/set_limit(Option<i32>)
:The maximum number of items returned. If you don’t specify a value, the default is up to 50 items.
- On success, responds with
DescribeLogStreamsOutput
with field(s):log_streams(Option<Vec<LogStream>>)
:The log streams.
next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeLogStreamsError>
sourcepub fn describe_metric_filters(&self) -> DescribeMetricFilters
pub fn describe_metric_filters(&self) -> DescribeMetricFilters
Constructs a fluent builder for the DescribeMetricFilters
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
filter_name_prefix(impl Into<String>)
/set_filter_name_prefix(Option<String>)
:The prefix to match. CloudWatch Logs uses the value you set here only if you also include the
logGroupName
parameter in your request.next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. (You received this token from a previous call.)
limit(i32)
/set_limit(Option<i32>)
:The maximum number of items returned. If you don’t specify a value, the default is up to 50 items.
metric_name(impl Into<String>)
/set_metric_name(Option<String>)
:Filters results to include only those with the specified metric name. If you include this parameter in your request, you must also include the
metricNamespace
parameter.metric_namespace(impl Into<String>)
/set_metric_namespace(Option<String>)
:Filters results to include only those in the specified namespace. If you include this parameter in your request, you must also include the
metricName
parameter.
- On success, responds with
DescribeMetricFiltersOutput
with field(s):metric_filters(Option<Vec<MetricFilter>>)
:The metric filters.
next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeMetricFiltersError>
sourcepub fn describe_queries(&self) -> DescribeQueries
pub fn describe_queries(&self) -> DescribeQueries
Constructs a fluent builder for the DescribeQueries
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:Limits the returned queries to only those for the specified log group.
status(QueryStatus)
/set_status(Option<QueryStatus>)
:Limits the returned queries to only those that have the specified status. Valid values are
Cancelled
,Complete
,Failed
,Running
, andScheduled
.max_results(i32)
/set_max_results(Option<i32>)
:Limits the number of returned queries to the specified number.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On success, responds with
DescribeQueriesOutput
with field(s):queries(Option<Vec<QueryInfo>>)
:The list of queries that match the request.
next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeQueriesError>
sourcepub fn describe_query_definitions(&self) -> DescribeQueryDefinitions
pub fn describe_query_definitions(&self) -> DescribeQueryDefinitions
Constructs a fluent builder for the DescribeQueryDefinitions
operation.
- The fluent builder is configurable:
query_definition_name_prefix(impl Into<String>)
/set_query_definition_name_prefix(Option<String>)
:Use this parameter to filter your results to only the query definitions that have names that start with the prefix you specify.
max_results(i32)
/set_max_results(Option<i32>)
:Limits the number of returned query definitions to the specified number.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On success, responds with
DescribeQueryDefinitionsOutput
with field(s):query_definitions(Option<Vec<QueryDefinition>>)
:The list of query definitions that match your request.
next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeQueryDefinitionsError>
sourcepub fn describe_resource_policies(&self) -> DescribeResourcePolicies
pub fn describe_resource_policies(&self) -> DescribeResourcePolicies
Constructs a fluent builder for the DescribeResourcePolicies
operation.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
limit(i32)
/set_limit(Option<i32>)
:The maximum number of resource policies to be displayed with one call of this API.
- On success, responds with
DescribeResourcePoliciesOutput
with field(s):resource_policies(Option<Vec<ResourcePolicy>>)
:The resource policies that exist in this account.
next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeResourcePoliciesError>
sourcepub fn describe_subscription_filters(&self) -> DescribeSubscriptionFilters
pub fn describe_subscription_filters(&self) -> DescribeSubscriptionFilters
Constructs a fluent builder for the DescribeSubscriptionFilters
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
filter_name_prefix(impl Into<String>)
/set_filter_name_prefix(Option<String>)
:The prefix to match. If you don’t specify a value, no prefix filter is applied.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. (You received this token from a previous call.)
limit(i32)
/set_limit(Option<i32>)
:The maximum number of items returned. If you don’t specify a value, the default is up to 50 items.
- On success, responds with
DescribeSubscriptionFiltersOutput
with field(s):subscription_filters(Option<Vec<SubscriptionFilter>>)
:The subscription filters.
next_token(Option<String>)
:The token for the next set of items to return. The token expires after 24 hours.
- On failure, responds with
SdkError<DescribeSubscriptionFiltersError>
sourcepub fn disassociate_kms_key(&self) -> DisassociateKmsKey
pub fn disassociate_kms_key(&self) -> DisassociateKmsKey
Constructs a fluent builder for the DisassociateKmsKey
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
- On success, responds with
DisassociateKmsKeyOutput
- On failure, responds with
SdkError<DisassociateKmsKeyError>
sourcepub fn filter_log_events(&self) -> FilterLogEvents
pub fn filter_log_events(&self) -> FilterLogEvents
Constructs a fluent builder for the FilterLogEvents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group to search.
log_stream_names(Vec<String>)
/set_log_stream_names(Option<Vec<String>>)
:Filters the results to only logs from the log streams in this list.
If you specify a value for both
logStreamNamePrefix
andlogStreamNames
, the action returns anInvalidParameterException
error.log_stream_name_prefix(impl Into<String>)
/set_log_stream_name_prefix(Option<String>)
:Filters the results to include only events from log streams that have names starting with this prefix.
If you specify a value for both
logStreamNamePrefix
andlogStreamNames
, but the value forlogStreamNamePrefix
does not match any log stream names specified inlogStreamNames
, the action returns anInvalidParameterException
error.start_time(i64)
/set_start_time(Option<i64>)
:The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time are not returned.
end_time(i64)
/set_end_time(Option<i64>)
:The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not returned.
filter_pattern(impl Into<String>)
/set_filter_pattern(Option<String>)
:The filter pattern to use. For more information, see Filter and Pattern Syntax.
If not provided, all the events are matched.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of events to return. (You received this token from a previous call.)
limit(i32)
/set_limit(Option<i32>)
:The maximum number of events to return. The default is 10,000 events.
interleaved(bool)
/set_interleaved(Option<bool>)
:If the value is true, the operation makes a best effort to provide responses that contain events from multiple log streams within the log group, interleaved in a single response. If the value is false, all the matched log events in the first log stream are searched first, then those in the next log stream, and so on. The default is false.
Important: Starting on June 17, 2019, this parameter is ignored and the value is assumed to be true. The response from this operation always interleaves events from multiple log streams within a log group.
- On success, responds with
FilterLogEventsOutput
with field(s):events(Option<Vec<FilteredLogEvent>>)
:The matched events.
searched_log_streams(Option<Vec<SearchedLogStream>>)
:IMPORTANT Starting on May 15, 2020, this parameter will be deprecated. This parameter will be an empty list after the deprecation occurs.
Indicates which log streams have been searched and whether each has been searched completely.
next_token(Option<String>)
:The token to use when requesting the next set of items. The token expires after 24 hours.
- On failure, responds with
SdkError<FilterLogEventsError>
sourcepub fn get_log_events(&self) -> GetLogEvents
pub fn get_log_events(&self) -> GetLogEvents
Constructs a fluent builder for the GetLogEvents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
log_stream_name(impl Into<String>)
/set_log_stream_name(Option<String>)
:The name of the log stream.
start_time(i64)
/set_start_time(Option<i64>)
:The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp equal to this time or later than this time are included. Events with a timestamp earlier than this time are not included.
end_time(i64)
/set_end_time(Option<i64>)
:The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp equal to or later than this time are not included.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of items to return. (You received this token from a previous call.)
limit(i32)
/set_limit(Option<i32>)
:The maximum number of log events returned. If you don’t specify a value, the maximum is as many log events as can fit in a response size of 1 MB, up to 10,000 log events.
start_from_head(bool)
/set_start_from_head(Option<bool>)
:If the value is true, the earliest log events are returned first. If the value is false, the latest log events are returned first. The default value is false.
If you are using a previous
nextForwardToken
value as thenextToken
in this operation, you must specifytrue
forstartFromHead
.
- On success, responds with
GetLogEventsOutput
with field(s):events(Option<Vec<OutputLogEvent>>)
:The events.
next_forward_token(Option<String>)
:The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.
next_backward_token(Option<String>)
:The token for the next set of items in the backward direction. The token expires after 24 hours. This token is never null. If you have reached the end of the stream, it returns the same token you passed in.
- On failure, responds with
SdkError<GetLogEventsError>
sourcepub fn get_log_group_fields(&self) -> GetLogGroupFields
pub fn get_log_group_fields(&self) -> GetLogGroupFields
Constructs a fluent builder for the GetLogGroupFields
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group to search.
time(i64)
/set_time(Option<i64>)
:The time to set as the center of the query. If you specify
time
, the 15 minutes before this time are queries. If you omittime
the 8 minutes before and 8 minutes after this time are searched.The
time
value is specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.
- On success, responds with
GetLogGroupFieldsOutput
with field(s):log_group_fields(Option<Vec<LogGroupField>>)
:The array of fields found in the query. Each object in the array contains the name of the field, along with the percentage of time it appeared in the log events that were queried.
- On failure, responds with
SdkError<GetLogGroupFieldsError>
sourcepub fn get_log_record(&self) -> GetLogRecord
pub fn get_log_record(&self) -> GetLogRecord
Constructs a fluent builder for the GetLogRecord
operation.
- The fluent builder is configurable:
log_record_pointer(impl Into<String>)
/set_log_record_pointer(Option<String>)
:The pointer corresponding to the log event record you want to retrieve. You get this from the response of a
GetQueryResults
operation. In that response, the value of the@ptr
field for a log event is the value to use aslogRecordPointer
to retrieve that complete log event record.
- On success, responds with
GetLogRecordOutput
with field(s):log_record(Option<HashMap<String, String>>)
:The requested log event, as a JSON string.
- On failure, responds with
SdkError<GetLogRecordError>
sourcepub fn get_query_results(&self) -> GetQueryResults
pub fn get_query_results(&self) -> GetQueryResults
Constructs a fluent builder for the GetQueryResults
operation.
- The fluent builder is configurable:
query_id(impl Into<String>)
/set_query_id(Option<String>)
:The ID number of the query.
- On success, responds with
GetQueryResultsOutput
with field(s):results(Option<Vec<Vec<ResultField>>>)
:The log events that matched the query criteria during the most recent time it ran.
The
results
value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array offield
/value
pairs.statistics(Option<QueryStatistics>)
:Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the log events that were scanned. These values reflect the full raw results of the query.
status(Option<QueryStatus>)
:The status of the most recent running of the query. Possible values are
Cancelled
,Complete
,Failed
,Running
,Scheduled
,Timeout
, andUnknown
.Queries time out after 15 minutes of execution. To avoid having your queries time out, reduce the time range being searched or partition your query into a number of queries.
- On failure, responds with
SdkError<GetQueryResultsError>
Constructs a fluent builder for the ListTagsLogGroup
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
- On success, responds with
ListTagsLogGroupOutput
with field(s):tags(Option<HashMap<String, String>>)
:The tags for the log group.
- On failure, responds with
SdkError<ListTagsLogGroupError>
sourcepub fn put_destination(&self) -> PutDestination
pub fn put_destination(&self) -> PutDestination
Constructs a fluent builder for the PutDestination
operation.
- The fluent builder is configurable:
destination_name(impl Into<String>)
/set_destination_name(Option<String>)
:A name for the destination.
target_arn(impl Into<String>)
/set_target_arn(Option<String>)
:The ARN of an Amazon Kinesis stream to which to deliver matching log events.
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:The ARN of an IAM role that grants CloudWatch Logs permissions to call the Amazon Kinesis
PutRecord
operation on the destination stream.
- On success, responds with
PutDestinationOutput
with field(s):destination(Option<Destination>)
:The destination.
- On failure, responds with
SdkError<PutDestinationError>
sourcepub fn put_destination_policy(&self) -> PutDestinationPolicy
pub fn put_destination_policy(&self) -> PutDestinationPolicy
Constructs a fluent builder for the PutDestinationPolicy
operation.
- The fluent builder is configurable:
destination_name(impl Into<String>)
/set_destination_name(Option<String>)
:A name for an existing destination.
access_policy(impl Into<String>)
/set_access_policy(Option<String>)
:An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.
force_update(bool)
/set_force_update(Option<bool>)
:Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual AWS accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying
true
forforceUpdate
, you are affirming that you have already updated the subscription filters. For more information, see Updating an existing cross-account subscriptionIf you omit this parameter, the default of
false
is used.
- On success, responds with
PutDestinationPolicyOutput
- On failure, responds with
SdkError<PutDestinationPolicyError>
sourcepub fn put_log_events(&self) -> PutLogEvents
pub fn put_log_events(&self) -> PutLogEvents
Constructs a fluent builder for the PutLogEvents
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
log_stream_name(impl Into<String>)
/set_log_stream_name(Option<String>)
:The name of the log stream.
log_events(Vec<InputLogEvent>)
/set_log_events(Option<Vec<InputLogEvent>>)
:The log events.
sequence_token(impl Into<String>)
/set_sequence_token(Option<String>)
:The sequence token obtained from the response of the previous
PutLogEvents
call. An upload in a newly created log stream does not require a sequence token. You can also get the sequence token using DescribeLogStreams. If you callPutLogEvents
twice within a narrow time period using the same value forsequenceToken
, both calls might be successful or one might be rejected.
- On success, responds with
PutLogEventsOutput
with field(s):next_sequence_token(Option<String>)
:The next sequence token.
rejected_log_events_info(Option<RejectedLogEventsInfo>)
:The rejected events.
- On failure, responds with
SdkError<PutLogEventsError>
sourcepub fn put_metric_filter(&self) -> PutMetricFilter
pub fn put_metric_filter(&self) -> PutMetricFilter
Constructs a fluent builder for the PutMetricFilter
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
filter_name(impl Into<String>)
/set_filter_name(Option<String>)
:A name for the metric filter.
filter_pattern(impl Into<String>)
/set_filter_pattern(Option<String>)
:A filter pattern for extracting metric data out of ingested log events.
metric_transformations(Vec<MetricTransformation>)
/set_metric_transformations(Option<Vec<MetricTransformation>>)
:A collection of information that defines how metric data gets emitted.
- On success, responds with
PutMetricFilterOutput
- On failure, responds with
SdkError<PutMetricFilterError>
sourcepub fn put_query_definition(&self) -> PutQueryDefinition
pub fn put_query_definition(&self) -> PutQueryDefinition
Constructs a fluent builder for the PutQueryDefinition
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:A name for the query definition. If you are saving a lot of query definitions, we recommend that you name them so that you can easily find the ones you want by using the first part of the name as a filter in the
queryDefinitionNamePrefix
parameter of DescribeQueryDefinitions.query_definition_id(impl Into<String>)
/set_query_definition_id(Option<String>)
:If you are updating a query definition, use this parameter to specify the ID of the query definition that you want to update. You can use DescribeQueryDefinitions to retrieve the IDs of your saved query definitions.
If you are creating a query definition, do not specify this parameter. CloudWatch generates a unique ID for the new query definition and include it in the response to this operation.
log_group_names(Vec<String>)
/set_log_group_names(Option<Vec<String>>)
:Use this parameter to include specific log groups as part of your query definition.
If you are updating a query definition and you omit this parameter, then the updated definition will contain no log groups.
query_string(impl Into<String>)
/set_query_string(Option<String>)
:The query string to use for this definition. For more information, see CloudWatch Logs Insights Query Syntax.
- On success, responds with
PutQueryDefinitionOutput
with field(s):query_definition_id(Option<String>)
:The ID of the query definition.
- On failure, responds with
SdkError<PutQueryDefinitionError>
sourcepub fn put_resource_policy(&self) -> PutResourcePolicy
pub fn put_resource_policy(&self) -> PutResourcePolicy
Constructs a fluent builder for the PutResourcePolicy
operation.
- The fluent builder is configurable:
policy_name(impl Into<String>)
/set_policy_name(Option<String>)
:Name of the new policy. This parameter is required.
policy_document(impl Into<String>)
/set_policy_document(Option<String>)
:Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. This parameter is required.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace
“logArn”
with the ARN of your CloudWatch Logs resource, such as a log group or log stream.CloudWatch Logs also supports aws:SourceArn and aws:SourceAccount condition context keys.
In the example resource policy, you would replace the value of
SourceArn
with the resource making the call from Route 53 to CloudWatch Logs and replace the value ofSourceAccount
with the Amazon Web Services account ID making that call.{ “Version”: “2012-10-17”, “Statement”: [ { “Sid”: “Route53LogsToCloudWatchLogs”, “Effect”: “Allow”, “Principal”: { “Service”: [ “route53.amazonaws.com” ] }, “Action”: “logs:PutLogEvents”, “Resource”: “logArn”, “Condition”: { “ArnLike”: { “aws:SourceArn”: “myRoute53ResourceArn” }, “StringEquals”: { “aws:SourceAccount”: “myAwsAccountId” } } } ] }
- On success, responds with
PutResourcePolicyOutput
with field(s):resource_policy(Option<ResourcePolicy>)
:The new policy.
- On failure, responds with
SdkError<PutResourcePolicyError>
sourcepub fn put_retention_policy(&self) -> PutRetentionPolicy
pub fn put_retention_policy(&self) -> PutRetentionPolicy
Constructs a fluent builder for the PutRetentionPolicy
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
retention_in_days(i32)
/set_retention_in_days(Option<i32>)
:The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.
To set a log group to never have log events expire, use DeleteRetentionPolicy.
- On success, responds with
PutRetentionPolicyOutput
- On failure, responds with
SdkError<PutRetentionPolicyError>
sourcepub fn put_subscription_filter(&self) -> PutSubscriptionFilter
pub fn put_subscription_filter(&self) -> PutSubscriptionFilter
Constructs a fluent builder for the PutSubscriptionFilter
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
filter_name(impl Into<String>)
/set_filter_name(Option<String>)
:A name for the subscription filter. If you are updating an existing filter, you must specify the correct name in
filterName
. To find the name of the filter currently associated with a log group, use DescribeSubscriptionFilters.filter_pattern(impl Into<String>)
/set_filter_pattern(Option<String>)
:A filter pattern for subscribing to a filtered stream of log events.
destination_arn(impl Into<String>)
/set_destination_arn(Option<String>)
:The ARN of the destination to deliver matching log events to. Currently, the supported destinations are:
-
An Amazon Kinesis stream belonging to the same account as the subscription filter, for same-account delivery.
-
A logical destination (specified using an ARN) belonging to a different account, for cross-account delivery.
If you are setting up a cross-account subscription, the destination must have an IAM policy associated with it that allows the sender to send logs to the destination. For more information, see PutDestinationPolicy.
-
An Amazon Kinesis Firehose delivery stream belonging to the same account as the subscription filter, for same-account delivery.
-
A Lambda function belonging to the same account as the subscription filter, for same-account delivery.
-
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don’t need to provide the ARN when you are working with a logical destination for cross-account delivery.
distribution(Distribution)
/set_distribution(Option<Distribution>)
:The method used to distribute log data to the destination. By default, log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream.
- On success, responds with
PutSubscriptionFilterOutput
- On failure, responds with
SdkError<PutSubscriptionFilterError>
sourcepub fn start_query(&self) -> StartQuery
pub fn start_query(&self) -> StartQuery
Constructs a fluent builder for the StartQuery
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The log group on which to perform the query.
A
StartQuery
operation must include alogGroupNames
or alogGroupName
parameter, but not both.log_group_names(Vec<String>)
/set_log_group_names(Option<Vec<String>>)
:The list of log groups to be queried. You can include up to 20 log groups.
A
StartQuery
operation must include alogGroupNames
or alogGroupName
parameter, but not both.start_time(i64)
/set_start_time(Option<i64>)
:The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.
end_time(i64)
/set_end_time(Option<i64>)
:The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.
query_string(impl Into<String>)
/set_query_string(Option<String>)
:The query string to use. For more information, see CloudWatch Logs Insights Query Syntax.
limit(i32)
/set_limit(Option<i32>)
:The maximum number of log events to return in the query. If the query string uses the
fields
command, only the specified fields and their values are returned. The default is 1000.
- On success, responds with
StartQueryOutput
with field(s):query_id(Option<String>)
:The unique ID of the query.
- On failure, responds with
SdkError<StartQueryError>
sourcepub fn stop_query(&self) -> StopQuery
pub fn stop_query(&self) -> StopQuery
Constructs a fluent builder for the StopQuery
operation.
- The fluent builder is configurable:
query_id(impl Into<String>)
/set_query_id(Option<String>)
:The ID number of the query to stop. To find this ID number, use
DescribeQueries
.
- On success, responds with
StopQueryOutput
with field(s):success(bool)
:This is true if the query was stopped by the
StopQuery
operation.
- On failure, responds with
SdkError<StopQueryError>
sourcepub fn tag_log_group(&self) -> TagLogGroup
pub fn tag_log_group(&self) -> TagLogGroup
Constructs a fluent builder for the TagLogGroup
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
:The key-value pairs to use for the tags.
- On success, responds with
TagLogGroupOutput
- On failure, responds with
SdkError<TagLogGroupError>
sourcepub fn test_metric_filter(&self) -> TestMetricFilter
pub fn test_metric_filter(&self) -> TestMetricFilter
Constructs a fluent builder for the TestMetricFilter
operation.
- The fluent builder is configurable:
filter_pattern(impl Into<String>)
/set_filter_pattern(Option<String>)
:A symbolic description of how CloudWatch Logs should interpret the data in each log event. For example, a log event can contain timestamps, IP addresses, strings, and so on. You use the filter pattern to specify what to look for in the log event message.
log_event_messages(Vec<String>)
/set_log_event_messages(Option<Vec<String>>)
:The log event messages to test.
- On success, responds with
TestMetricFilterOutput
with field(s):matches(Option<Vec<MetricFilterMatchRecord>>)
:The matched events.
- On failure, responds with
SdkError<TestMetricFilterError>
sourcepub fn untag_log_group(&self) -> UntagLogGroup
pub fn untag_log_group(&self) -> UntagLogGroup
Constructs a fluent builder for the UntagLogGroup
operation.
- The fluent builder is configurable:
log_group_name(impl Into<String>)
/set_log_group_name(Option<String>)
:The name of the log group.
tags(Vec<String>)
/set_tags(Option<Vec<String>>)
:The tag keys. The corresponding tags are removed from the log group.
- On success, responds with
UntagLogGroupOutput
- On failure, responds with
SdkError<UntagLogGroupError>
sourceimpl Client
impl Client
sourcepub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
pub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
Creates a client with the given service config and connector override.
Trait Implementations
sourceimpl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
impl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
sourcefn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
fn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more