Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59638,6 +59638,39 @@ paths:
summary: Get AWS integration IAM permissions
tags:
- AWS Integration
/api/v2/integration/aws/iam_permissions/resource_collection:
get:
description: Get all resource collection AWS IAM permissions required for the
AWS integration.
operationId: GetAWSIntegrationIAMPermissionsResourceCollection
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponse'
description: AWS integration resource collection IAM permissions.
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get resource collection IAM permissions
tags:
- AWS Integration
/api/v2/integration/aws/iam_permissions/standard:
get:
description: Get all standard AWS IAM permissions required for the AWS integration.
operationId: GetAWSIntegrationIAMPermissionsStandard
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponse'
description: AWS integration standard IAM permissions.
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get AWS integration standard IAM permissions
tags:
- AWS Integration
/api/v2/integration/aws/logs/services:
get:
description: Get a list of AWS services that can send logs to Datadog.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Get resource collection IAM permissions returns "AWS integration resource
// collection IAM permissions." response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = AWSIntegrationAPI::with_config(configuration);
let resp = api
.get_aws_integration_iam_permissions_resource_collection()
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Get resource collection IAM permissions returns "AWS IAM Permissions object"
// response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = AWSIntegrationAPI::with_config(configuration);
let resp = api
.get_aws_integration_iam_permissions_resource_collection()
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Get AWS integration standard IAM permissions returns "AWS integration standard
// IAM permissions." response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = AWSIntegrationAPI::with_config(configuration);
let resp = api.get_aws_integration_iam_permissions_standard().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Get AWS integration standard IAM permissions returns "AWS IAM Permissions
// object" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_aws_integration::AWSIntegrationAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = AWSIntegrationAPI::with_config(configuration);
let resp = api.get_aws_integration_iam_permissions_standard().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
236 changes: 236 additions & 0 deletions src/datadogV2/api/api_aws_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ pub enum GetAWSIntegrationIAMPermissionsError {
UnknownValue(serde_json::Value),
}

/// GetAWSIntegrationIAMPermissionsResourceCollectionError is a struct for typed errors of method [`AWSIntegrationAPI::get_aws_integration_iam_permissions_resource_collection`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetAWSIntegrationIAMPermissionsResourceCollectionError {
APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
UnknownValue(serde_json::Value),
}

/// GetAWSIntegrationIAMPermissionsStandardError is a struct for typed errors of method [`AWSIntegrationAPI::get_aws_integration_iam_permissions_standard`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetAWSIntegrationIAMPermissionsStandardError {
APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
UnknownValue(serde_json::Value),
}

/// ListAWSAccountsError is a struct for typed errors of method [`AWSIntegrationAPI::list_aws_accounts`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -725,6 +741,226 @@ impl AWSIntegrationAPI {
}
}

/// Get all resource collection AWS IAM permissions required for the AWS integration.
pub async fn get_aws_integration_iam_permissions_resource_collection(
&self,
) -> Result<
crate::datadogV2::model::AWSIntegrationIamPermissionsResponse,
datadog::Error<GetAWSIntegrationIAMPermissionsResourceCollectionError>,
> {
match self
.get_aws_integration_iam_permissions_resource_collection_with_http_info()
.await
{
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
} else {
Err(datadog::Error::Serde(serde::de::Error::custom(
"response content was None",
)))
}
}
Err(err) => Err(err),
}
}

/// Get all resource collection AWS IAM permissions required for the AWS integration.
pub async fn get_aws_integration_iam_permissions_resource_collection_with_http_info(
&self,
) -> Result<
datadog::ResponseContent<crate::datadogV2::model::AWSIntegrationIamPermissionsResponse>,
datadog::Error<GetAWSIntegrationIAMPermissionsResourceCollectionError>,
> {
let local_configuration = &self.config;
let operation_id = "v2.get_aws_integration_iam_permissions_resource_collection";

let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/integration/aws/iam_permissions/resource_collection",
local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());

// build headers
let mut headers = HeaderMap::new();
headers.insert("Accept", HeaderValue::from_static("application/json"));

// build user agent
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
Err(e) => {
log::warn!("Failed to parse user agent header: {e}, falling back to default");
headers.insert(
reqwest::header::USER_AGENT,
HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
)
}
};

// build auth
if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
headers.insert(
"DD-API-KEY",
HeaderValue::from_str(local_key.key.as_str())
.expect("failed to parse DD-API-KEY header"),
);
};
if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
headers.insert(
"DD-APPLICATION-KEY",
HeaderValue::from_str(local_key.key.as_str())
.expect("failed to parse DD-APPLICATION-KEY header"),
);
};

local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
log::debug!("request content: {:?}", local_req.body());
let local_resp = local_client.execute(local_req).await?;

let local_status = local_resp.status();
let local_content = local_resp.text().await?;
log::debug!("response content: {}", local_content);

if !local_status.is_client_error() && !local_status.is_server_error() {
match serde_json::from_str::<
crate::datadogV2::model::AWSIntegrationIamPermissionsResponse,
>(&local_content)
{
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
content: local_content,
entity: Some(e),
})
}
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
let local_entity: Option<GetAWSIntegrationIAMPermissionsResourceCollectionError> =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
entity: local_entity,
};
Err(datadog::Error::ResponseError(local_error))
}
}

/// Get all standard AWS IAM permissions required for the AWS integration.
pub async fn get_aws_integration_iam_permissions_standard(
&self,
) -> Result<
crate::datadogV2::model::AWSIntegrationIamPermissionsResponse,
datadog::Error<GetAWSIntegrationIAMPermissionsStandardError>,
> {
match self
.get_aws_integration_iam_permissions_standard_with_http_info()
.await
{
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
} else {
Err(datadog::Error::Serde(serde::de::Error::custom(
"response content was None",
)))
}
}
Err(err) => Err(err),
}
}

/// Get all standard AWS IAM permissions required for the AWS integration.
pub async fn get_aws_integration_iam_permissions_standard_with_http_info(
&self,
) -> Result<
datadog::ResponseContent<crate::datadogV2::model::AWSIntegrationIamPermissionsResponse>,
datadog::Error<GetAWSIntegrationIAMPermissionsStandardError>,
> {
let local_configuration = &self.config;
let operation_id = "v2.get_aws_integration_iam_permissions_standard";

let local_client = &self.client;

let local_uri_str = format!(
"{}/api/v2/integration/aws/iam_permissions/standard",
local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());

// build headers
let mut headers = HeaderMap::new();
headers.insert("Accept", HeaderValue::from_static("application/json"));

// build user agent
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
Err(e) => {
log::warn!("Failed to parse user agent header: {e}, falling back to default");
headers.insert(
reqwest::header::USER_AGENT,
HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
)
}
};

// build auth
if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
headers.insert(
"DD-API-KEY",
HeaderValue::from_str(local_key.key.as_str())
.expect("failed to parse DD-API-KEY header"),
);
};
if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
headers.insert(
"DD-APPLICATION-KEY",
HeaderValue::from_str(local_key.key.as_str())
.expect("failed to parse DD-APPLICATION-KEY header"),
);
};

local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
log::debug!("request content: {:?}", local_req.body());
let local_resp = local_client.execute(local_req).await?;

let local_status = local_resp.status();
let local_content = local_resp.text().await?;
log::debug!("response content: {}", local_content);

if !local_status.is_client_error() && !local_status.is_server_error() {
match serde_json::from_str::<
crate::datadogV2::model::AWSIntegrationIamPermissionsResponse,
>(&local_content)
{
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
content: local_content,
entity: Some(e),
})
}
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
let local_entity: Option<GetAWSIntegrationIAMPermissionsStandardError> =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
entity: local_entity,
};
Err(datadog::Error::ResponseError(local_error))
}
}

/// Get a list of AWS Account Integration Configs.
pub async fn list_aws_accounts(
&self,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-09-17T18:27:22.560Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"http_interactions": [
{
"request": {
"body": "",
"headers": {
"Accept": [
"application/json"
]
},
"method": "get",
"uri": "https://api.datadoghq.com/api/v2/integration/aws/iam_permissions/standard"
},
"response": {
"body": {
"string": "{\"data\":{\"id\":\"permissions\",\"type\":\"permissions\",\"attributes\":{\"permissions\":[\"account:GetAccountInformation\",\"airflow:GetEnvironment\",\"airflow:ListEnvironments\",\"apigateway:GET\",\"appsync:ListGraphqlApis\",\"autoscaling:Describe*\",\"backup:List*\",\"batch:DescribeJobDefinitions\",\"bcm-data-exports:GetExport\",\"bcm-data-exports:ListExports\",\"budgets:ViewBudget\",\"cloudfront:GetDistributionConfig\",\"cloudfront:ListDistributions\",\"cloudtrail:DescribeTrails\",\"cloudtrail:GetTrail\",\"cloudtrail:GetTrailStatus\",\"cloudtrail:ListTrails\",\"cloudtrail:LookupEvents\",\"cloudwatch:Describe*\",\"cloudwatch:Get*\",\"cloudwatch:List*\",\"codebuild:BatchGetProjects\",\"codebuild:ListProjects\",\"codedeploy:BatchGet*\",\"codedeploy:List*\",\"cur:DescribeReportDefinitions\",\"directconnect:Describe*\",\"dms:DescribeReplicationInstances\",\"dynamodb:Describe*\",\"dynamodb:List*\",\"ec2:Describe*\",\"ecs:Describe*\",\"ecs:List*\",\"eks:DescribeCluster\",\"eks:ListClusters\",\"elasticache:Describe*\",\"elasticache:List*\",\"elasticfilesystem:DescribeAccessPoints\",\"elasticfilesystem:DescribeFileSystems\",\"elasticfilesystem:DescribeTags\",\"elasticloadbalancing:Describe*\",\"elasticmapreduce:Describe*\",\"elasticmapreduce:List*\",\"es:DescribeElasticsearchDomains\",\"es:ListDomainNames\",\"es:ListTags\",\"events:CreateEventBus\",\"fsx:DescribeFileSystems\",\"fsx:ListTagsForResource\",\"health:DescribeAffectedEntities\",\"health:DescribeEventDetails\",\"health:DescribeEvents\",\"iam:ListAccountAliases\",\"kinesis:Describe*\",\"kinesis:List*\",\"lambda:List*\",\"logs:DeleteSubscriptionFilter\",\"logs:DescribeDeliveries\",\"logs:DescribeDeliverySources\",\"logs:DescribeLogGroups\",\"logs:DescribeLogStreams\",\"logs:DescribeSubscriptionFilters\",\"logs:FilterLogEvents\",\"logs:GetDeliveryDestination\",\"logs:PutSubscriptionFilter\",\"logs:TestMetricFilter\",\"network-firewall:DescribeLoggingConfiguration\",\"network-firewall:ListFirewalls\",\"oam:ListAttachedLinks\",\"oam:ListSinks\",\"organizations:Describe*\",\"organizations:List*\",\"rds:Describe*\",\"rds:List*\",\"redshift-serverless:ListNamespaces\",\"redshift:DescribeClusters\",\"redshift:DescribeLoggingStatus\",\"route53:List*\",\"route53resolver:ListResolverQueryLogConfigs\",\"s3:GetBucketLocation\",\"s3:GetBucketLogging\",\"s3:GetBucketNotification\",\"s3:GetBucketTagging\",\"s3:ListAllMyBuckets\",\"s3:PutBucketNotification\",\"ses:Get*\",\"ses:List*\",\"sns:GetSubscriptionAttributes\",\"sns:List*\",\"sns:Publish\",\"sqs:ListQueues\",\"ssm:GetServiceSetting\",\"ssm:ListCommands\",\"states:DescribeStateMachine\",\"states:ListStateMachines\",\"support:DescribeTrustedAdvisor*\",\"support:RefreshTrustedAdvisorCheck\",\"tag:GetResources\",\"tag:GetTagKeys\",\"tag:GetTagValues\",\"timestream:DescribeEndpoints\",\"wafv2:ListLoggingConfigurations\",\"xray:BatchGetTraces\",\"xray:GetTraceSummaries\"]}}}",
"encoding": null
},
"headers": {
"Content-Type": [
"application/vnd.api+json"
]
},
"status": {
"code": 200,
"message": "OK"
}
},
"recorded_at": "Wed, 17 Sep 2025 18:27:22 GMT"
}
],
"recorded_with": "VCR 6.0.0"
}
Loading