Struct AWSLogsIntegrationAPI

Source
pub struct AWSLogsIntegrationAPI { /* private fields */ }
Expand description

Configure your Datadog-AWS-Logs integration directly through Datadog API. For more information, see the AWS integration page.

Implementations§

Source§

impl AWSLogsIntegrationAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v1_aws-logs-integration_ListAWSLogsServices.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = AWSLogsIntegrationAPI::with_config(configuration);
9    let resp = api.list_aws_logs_services().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v1_aws-logs-integration_ListAWSLogsIntegrations.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = AWSLogsIntegrationAPI::with_config(configuration);
9    let resp = api.list_aws_logs_integrations().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v1_aws-logs-integration_CreateAWSLambdaARN.rs (line 13)
7async fn main() {
8    let body = AWSAccountAndLambdaRequest::new(
9        "1234567".to_string(),
10        "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(),
11    );
12    let configuration = datadog::Configuration::new();
13    let api = AWSLogsIntegrationAPI::with_config(configuration);
14    let resp = api.create_aws_lambda_arn(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}
examples/v1_aws-logs-integration_DeleteAWSLambdaARN.rs (line 13)
7async fn main() {
8    let body = AWSAccountAndLambdaRequest::new(
9        "1234567".to_string(),
10        "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(),
11    );
12    let configuration = datadog::Configuration::new();
13    let api = AWSLogsIntegrationAPI::with_config(configuration);
14    let resp = api.delete_aws_lambda_arn(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}
examples/v1_aws-logs-integration_CheckAWSLogsLambdaAsync.rs (line 13)
7async fn main() {
8    let body = AWSAccountAndLambdaRequest::new(
9        "1234567".to_string(),
10        "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(),
11    );
12    let configuration = datadog::Configuration::new();
13    let api = AWSLogsIntegrationAPI::with_config(configuration);
14    let resp = api.check_aws_logs_lambda_async(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}
examples/v1_aws-logs-integration_EnableAWSLogServices.rs (line 20)
7async fn main() {
8    let body = AWSLogsServicesRequest::new(
9        "1234567".to_string(),
10        vec![
11            "s3".to_string(),
12            "elb".to_string(),
13            "elbv2".to_string(),
14            "cloudfront".to_string(),
15            "redshift".to_string(),
16            "lambda".to_string(),
17        ],
18    );
19    let configuration = datadog::Configuration::new();
20    let api = AWSLogsIntegrationAPI::with_config(configuration);
21    let resp = api.enable_aws_log_services(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

pub async fn check_aws_logs_lambda_async( &self, body: AWSAccountAndLambdaRequest, ) -> Result<AWSLogsAsyncResponse, Error<CheckAWSLogsLambdaAsyncError>>

Test if permissions are present to add a log-forwarding triggers for the given services and AWS account. The input is the same as for Enable an AWS service log collection. Subsequent requests will always repeat the above, so this endpoint can be polled intermittently instead of blocking.

  • Returns a status of ‘created’ when it’s checking if the Lambda exists in the account.
  • Returns a status of ‘waiting’ while checking.
  • Returns a status of ‘checked and ok’ if the Lambda exists.
  • Returns a status of ‘error’ if the Lambda does not exist.
Examples found in repository?
examples/v1_aws-logs-integration_CheckAWSLogsLambdaAsync.rs (line 14)
7async fn main() {
8    let body = AWSAccountAndLambdaRequest::new(
9        "1234567".to_string(),
10        "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(),
11    );
12    let configuration = datadog::Configuration::new();
13    let api = AWSLogsIntegrationAPI::with_config(configuration);
14    let resp = api.check_aws_logs_lambda_async(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}
Source

pub async fn check_aws_logs_lambda_async_with_http_info( &self, body: AWSAccountAndLambdaRequest, ) -> Result<ResponseContent<AWSLogsAsyncResponse>, Error<CheckAWSLogsLambdaAsyncError>>

Test if permissions are present to add a log-forwarding triggers for the given services and AWS account. The input is the same as for Enable an AWS service log collection. Subsequent requests will always repeat the above, so this endpoint can be polled intermittently instead of blocking.

  • Returns a status of ‘created’ when it’s checking if the Lambda exists in the account.
  • Returns a status of ‘waiting’ while checking.
  • Returns a status of ‘checked and ok’ if the Lambda exists.
  • Returns a status of ‘error’ if the Lambda does not exist.
Source

pub async fn check_aws_logs_services_async( &self, body: AWSLogsServicesRequest, ) -> Result<AWSLogsAsyncResponse, Error<CheckAWSLogsServicesAsyncError>>

Test if permissions are present to add log-forwarding triggers for the given services and AWS account. Input is the same as for EnableAWSLogServices. Done async, so can be repeatedly polled in a non-blocking fashion until the async request completes.

  • Returns a status of created when it’s checking if the permissions exists in the AWS account.
  • Returns a status of waiting while checking.
  • Returns a status of checked and ok if the Lambda exists.
  • Returns a status of error if the Lambda does not exist.
Examples found in repository?
examples/v1_aws-logs-integration_CheckAWSLogsServicesAsync.rs (line 21)
7async fn main() {
8    let body = AWSLogsServicesRequest::new(
9        "1234567".to_string(),
10        vec![
11            "s3".to_string(),
12            "elb".to_string(),
13            "elbv2".to_string(),
14            "cloudfront".to_string(),
15            "redshift".to_string(),
16            "lambda".to_string(),
17        ],
18    );
19    let configuration = datadog::Configuration::new();
20    let api = AWSLogsIntegrationAPI::with_config(configuration);
21    let resp = api.check_aws_logs_services_async(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}
Source

pub async fn check_aws_logs_services_async_with_http_info( &self, body: AWSLogsServicesRequest, ) -> Result<ResponseContent<AWSLogsAsyncResponse>, Error<CheckAWSLogsServicesAsyncError>>

Test if permissions are present to add log-forwarding triggers for the given services and AWS account. Input is the same as for EnableAWSLogServices. Done async, so can be repeatedly polled in a non-blocking fashion until the async request completes.

  • Returns a status of created when it’s checking if the permissions exists in the AWS account.
  • Returns a status of waiting while checking.
  • Returns a status of checked and ok if the Lambda exists.
  • Returns a status of error if the Lambda does not exist.
Source

pub async fn create_aws_lambda_arn( &self, body: AWSAccountAndLambdaRequest, ) -> Result<BTreeMap<String, Value>, Error<CreateAWSLambdaARNError>>

Attach the Lambda ARN of the Lambda created for the Datadog-AWS log collection to your AWS account ID to enable log collection.

Examples found in repository?
examples/v1_aws-logs-integration_CreateAWSLambdaARN.rs (line 14)
7async fn main() {
8    let body = AWSAccountAndLambdaRequest::new(
9        "1234567".to_string(),
10        "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(),
11    );
12    let configuration = datadog::Configuration::new();
13    let api = AWSLogsIntegrationAPI::with_config(configuration);
14    let resp = api.create_aws_lambda_arn(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}
Source

pub async fn create_aws_lambda_arn_with_http_info( &self, body: AWSAccountAndLambdaRequest, ) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<CreateAWSLambdaARNError>>

Attach the Lambda ARN of the Lambda created for the Datadog-AWS log collection to your AWS account ID to enable log collection.

Source

pub async fn delete_aws_lambda_arn( &self, body: AWSAccountAndLambdaRequest, ) -> Result<BTreeMap<String, Value>, Error<DeleteAWSLambdaARNError>>

Delete a Datadog-AWS logs configuration by removing the specific Lambda ARN associated with a given AWS account.

Examples found in repository?
examples/v1_aws-logs-integration_DeleteAWSLambdaARN.rs (line 14)
7async fn main() {
8    let body = AWSAccountAndLambdaRequest::new(
9        "1234567".to_string(),
10        "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest".to_string(),
11    );
12    let configuration = datadog::Configuration::new();
13    let api = AWSLogsIntegrationAPI::with_config(configuration);
14    let resp = api.delete_aws_lambda_arn(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}
Source

pub async fn delete_aws_lambda_arn_with_http_info( &self, body: AWSAccountAndLambdaRequest, ) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<DeleteAWSLambdaARNError>>

Delete a Datadog-AWS logs configuration by removing the specific Lambda ARN associated with a given AWS account.

Source

pub async fn enable_aws_log_services( &self, body: AWSLogsServicesRequest, ) -> Result<BTreeMap<String, Value>, Error<EnableAWSLogServicesError>>

Enable automatic log collection for a list of services. This should be run after running CreateAWSLambdaARN to save the configuration.

Examples found in repository?
examples/v1_aws-logs-integration_EnableAWSLogServices.rs (line 21)
7async fn main() {
8    let body = AWSLogsServicesRequest::new(
9        "1234567".to_string(),
10        vec![
11            "s3".to_string(),
12            "elb".to_string(),
13            "elbv2".to_string(),
14            "cloudfront".to_string(),
15            "redshift".to_string(),
16            "lambda".to_string(),
17        ],
18    );
19    let configuration = datadog::Configuration::new();
20    let api = AWSLogsIntegrationAPI::with_config(configuration);
21    let resp = api.enable_aws_log_services(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}
Source

pub async fn enable_aws_log_services_with_http_info( &self, body: AWSLogsServicesRequest, ) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<EnableAWSLogServicesError>>

Enable automatic log collection for a list of services. This should be run after running CreateAWSLambdaARN to save the configuration.

Source

pub async fn list_aws_logs_integrations( &self, ) -> Result<Vec<AWSLogsListResponse>, Error<ListAWSLogsIntegrationsError>>

List all Datadog-AWS Logs integrations configured in your Datadog account.

Examples found in repository?
examples/v1_aws-logs-integration_ListAWSLogsIntegrations.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = AWSLogsIntegrationAPI::with_config(configuration);
9    let resp = api.list_aws_logs_integrations().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_aws_logs_integrations_with_http_info( &self, ) -> Result<ResponseContent<Vec<AWSLogsListResponse>>, Error<ListAWSLogsIntegrationsError>>

List all Datadog-AWS Logs integrations configured in your Datadog account.

Source

pub async fn list_aws_logs_services( &self, ) -> Result<Vec<AWSLogsListServicesResponse>, Error<ListAWSLogsServicesError>>

Get the list of current AWS services that Datadog offers automatic log collection. Use returned service IDs with the services parameter for the Enable an AWS service log collection API endpoint.

Examples found in repository?
examples/v1_aws-logs-integration_ListAWSLogsServices.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = AWSLogsIntegrationAPI::with_config(configuration);
9    let resp = api.list_aws_logs_services().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_aws_logs_services_with_http_info( &self, ) -> Result<ResponseContent<Vec<AWSLogsListServicesResponse>>, Error<ListAWSLogsServicesError>>

Get the list of current AWS services that Datadog offers automatic log collection. Use returned service IDs with the services parameter for the Enable an AWS service log collection API endpoint.

Trait Implementations§

Source§

impl Clone for AWSLogsIntegrationAPI

Source§

fn clone(&self) -> AWSLogsIntegrationAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AWSLogsIntegrationAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AWSLogsIntegrationAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,