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

Creates a client with the given service configuration.

Returns the client’s configuration.

Constructs a fluent builder for the AssociateKmsKey operation.

Constructs a fluent builder for the CancelExportTask operation.

Constructs a fluent builder for the CreateExportTask operation.

Constructs a fluent builder for the CreateLogGroup operation.

Constructs a fluent builder for the CreateLogStream operation.

Constructs a fluent builder for the DeleteDestination operation.

Constructs a fluent builder for the DeleteLogGroup operation.

Constructs a fluent builder for the DeleteLogStream operation.

Constructs a fluent builder for the DeleteMetricFilter operation.

Constructs a fluent builder for the DeleteQueryDefinition operation.

Constructs a fluent builder for the DeleteResourcePolicy operation.

Constructs a fluent builder for the DeleteRetentionPolicy operation.

Constructs a fluent builder for the DeleteSubscriptionFilter operation.

Constructs a fluent builder for the DescribeDestinations operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the DescribeExportTasks operation.

Constructs a fluent builder for the DescribeLogGroups operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the DescribeLogStreams operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the DescribeMetricFilters operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the DescribeQueries operation.

Constructs a fluent builder for the DescribeQueryDefinitions operation.

Constructs a fluent builder for the DescribeResourcePolicies operation.

Constructs a fluent builder for the DescribeSubscriptionFilters operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the DisassociateKmsKey operation.

Constructs a fluent builder for the FilterLogEvents operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the GetLogEvents operation. This operation supports pagination; See into_paginator().

Constructs a fluent builder for the GetLogGroupFields operation.

Constructs a fluent builder for the GetLogRecord operation.

Constructs a fluent builder for the GetQueryResults operation.

  • The fluent builder is configurable:
  • 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 of field/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, and Unknown.

      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.

Constructs a fluent builder for the PutDestination operation.

Constructs a fluent builder for the PutDestinationPolicy operation.

Constructs a fluent builder for the PutLogEvents operation.

Constructs a fluent builder for the PutMetricFilter operation.

Constructs a fluent builder for the PutQueryDefinition operation.

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 of SourceAccount 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):
  • On failure, responds with SdkError<PutResourcePolicyError>

Constructs a fluent builder for the PutRetentionPolicy operation.

Constructs a fluent builder for the PutSubscriptionFilter operation.

Constructs a fluent builder for the StartQuery operation.

Constructs a fluent builder for the StopQuery operation.

Constructs a fluent builder for the TagLogGroup operation.

Constructs a fluent builder for the TestMetricFilter operation.

Constructs a fluent builder for the UntagLogGroup operation.

Creates a client with the given service config and connector override.

Creates a new client from a shared config.

Creates a new client from the service Config.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more