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
impl AWSLogsIntegrationAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
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}
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}
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}
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}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn check_aws_logs_lambda_async(
&self,
body: AWSAccountAndLambdaRequest,
) -> Result<AWSLogsAsyncResponse, Error<CheckAWSLogsLambdaAsyncError>>
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?
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}
Sourcepub async fn check_aws_logs_lambda_async_with_http_info(
&self,
body: AWSAccountAndLambdaRequest,
) -> Result<ResponseContent<AWSLogsAsyncResponse>, Error<CheckAWSLogsLambdaAsyncError>>
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.
Sourcepub async fn check_aws_logs_services_async(
&self,
body: AWSLogsServicesRequest,
) -> Result<AWSLogsAsyncResponse, Error<CheckAWSLogsServicesAsyncError>>
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?
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}
Sourcepub async fn check_aws_logs_services_async_with_http_info(
&self,
body: AWSLogsServicesRequest,
) -> Result<ResponseContent<AWSLogsAsyncResponse>, Error<CheckAWSLogsServicesAsyncError>>
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.
Sourcepub async fn create_aws_lambda_arn(
&self,
body: AWSAccountAndLambdaRequest,
) -> Result<BTreeMap<String, Value>, Error<CreateAWSLambdaARNError>>
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?
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}
Sourcepub async fn create_aws_lambda_arn_with_http_info(
&self,
body: AWSAccountAndLambdaRequest,
) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<CreateAWSLambdaARNError>>
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.
Sourcepub async fn delete_aws_lambda_arn(
&self,
body: AWSAccountAndLambdaRequest,
) -> Result<BTreeMap<String, Value>, Error<DeleteAWSLambdaARNError>>
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?
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}
Sourcepub async fn delete_aws_lambda_arn_with_http_info(
&self,
body: AWSAccountAndLambdaRequest,
) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<DeleteAWSLambdaARNError>>
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.
Sourcepub async fn enable_aws_log_services(
&self,
body: AWSLogsServicesRequest,
) -> Result<BTreeMap<String, Value>, Error<EnableAWSLogServicesError>>
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?
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}
Sourcepub async fn enable_aws_log_services_with_http_info(
&self,
body: AWSLogsServicesRequest,
) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<EnableAWSLogServicesError>>
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.
Sourcepub async fn list_aws_logs_integrations(
&self,
) -> Result<Vec<AWSLogsListResponse>, Error<ListAWSLogsIntegrationsError>>
pub async fn list_aws_logs_integrations( &self, ) -> Result<Vec<AWSLogsListResponse>, Error<ListAWSLogsIntegrationsError>>
List all Datadog-AWS Logs integrations configured in your Datadog account.
Sourcepub async fn list_aws_logs_integrations_with_http_info(
&self,
) -> Result<ResponseContent<Vec<AWSLogsListResponse>>, Error<ListAWSLogsIntegrationsError>>
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.
Sourcepub async fn list_aws_logs_services(
&self,
) -> Result<Vec<AWSLogsListServicesResponse>, Error<ListAWSLogsServicesError>>
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.
Sourcepub async fn list_aws_logs_services_with_http_info(
&self,
) -> Result<ResponseContent<Vec<AWSLogsListServicesResponse>>, Error<ListAWSLogsServicesError>>
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
impl Clone for AWSLogsIntegrationAPI
Source§fn clone(&self) -> AWSLogsIntegrationAPI
fn clone(&self) -> AWSLogsIntegrationAPI
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more