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
230 changes: 230 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ components:
schema:
example: "2020-11-24T18:46:21+00:00"
type: string
ApplicationKeyFilterOwnedByParameter:
description: Filter application keys by owner ID.
in: query
name: filter[owned_by]
required: false
schema:
type: string
ApplicationKeyFilterParameter:
description: Filter application keys by the specified string.
in: query
Expand Down Expand Up @@ -2693,6 +2700,158 @@ components:
type: string
x-enum-varnames:
- CCM_CONFIG
AWSCcmConfigValidationIssue:
description: A single validation issue found while validating an AWS Cost and Usage Report (CUR) 2.0 configuration.
properties:
code:
$ref: "#/components/schemas/AWSCcmConfigValidationIssueCode"
description:
description: Human-readable description of the validation issue.
example: 'no CUR 2.0 export named "cost-and-usage-report" found'
type: string
required:
- code
- description
type: object
AWSCcmConfigValidationIssueCode:
description: Identifies the specific reason a Cost and Usage Report (CUR) 2.0 configuration failed validation.
enum:
- ISSUE_CODE_UNSPECIFIED
- CREDENTIAL_ERROR
- BUCKET_NAME_INVALID_GOVCLOUD
- S3_LIST_PERMISSION_MISSING
- S3_GET_PERMISSION_MISSING
- S3_BUCKET_REGION_MISMATCH
- S3_BUCKET_NOT_ACCESSIBLE
- EXPORT_LIST_PERMISSION_MISSING
- EXPORT_GET_PERMISSION_MISSING
- EXPORT_NOT_FOUND
- EXPORT_STATUS_UNHEALTHY
- TIME_GRANULARITY_INVALID
- FILE_FORMAT_INVALID
- INCLUDE_RESOURCES_DISABLED
- REFRESH_CADENCE_INVALID
- OVERWRITE_MODE_INVALID
- QUERY_STATEMENT_INVALID
example: "EXPORT_NOT_FOUND"
type: string
x-enum-varnames:
- ISSUE_CODE_UNSPECIFIED
- CREDENTIAL_ERROR
- BUCKET_NAME_INVALID_GOVCLOUD
- S3_LIST_PERMISSION_MISSING
- S3_GET_PERMISSION_MISSING
- S3_BUCKET_REGION_MISMATCH
- S3_BUCKET_NOT_ACCESSIBLE
- EXPORT_LIST_PERMISSION_MISSING
- EXPORT_GET_PERMISSION_MISSING
- EXPORT_NOT_FOUND
- EXPORT_STATUS_UNHEALTHY
- TIME_GRANULARITY_INVALID
- FILE_FORMAT_INVALID
- INCLUDE_RESOURCES_DISABLED
- REFRESH_CADENCE_INVALID
- OVERWRITE_MODE_INVALID
- QUERY_STATEMENT_INVALID
AWSCcmConfigValidationIssues:
description: List of validation issues found for the Cost and Usage Report (CUR) 2.0 configuration. Empty when the configuration is valid.
items:
$ref: "#/components/schemas/AWSCcmConfigValidationIssue"
type: array
AWSCcmConfigValidationRequest:
description: AWS CCM config validation request body.
properties:
data:
$ref: "#/components/schemas/AWSCcmConfigValidationRequestData"
required:
- data
type: object
AWSCcmConfigValidationRequestAttributes:
description: Attributes for an AWS CCM config validation request.
properties:
account_id:
description: Your AWS Account ID without dashes.
example: "123456789012"
type: string
bucket_name:
description: Name of the S3 bucket where the Cost and Usage Report is stored.
example: "billing"
type: string
bucket_region:
description: AWS region of the S3 bucket.
example: "us-east-1"
type: string
report_name:
description: Name of the Cost and Usage Report.
example: "cost-and-usage-report"
type: string
report_prefix:
description: S3 prefix where the Cost and Usage Report is stored.
example: "reports"
type: string
required:
- account_id
- bucket_name
- bucket_region
- report_name
type: object
AWSCcmConfigValidationRequestData:
description: AWS CCM config validation request data.
properties:
attributes:
$ref: "#/components/schemas/AWSCcmConfigValidationRequestAttributes"
type:
$ref: "#/components/schemas/AWSCcmConfigValidationType"
required:
- attributes
- type
type: object
AWSCcmConfigValidationResponse:
description: AWS CCM config validation response body.
properties:
data:
$ref: "#/components/schemas/AWSCcmConfigValidationResponseData"
required:
- data
type: object
AWSCcmConfigValidationResponseAttributes:
description: Attributes for an AWS CCM config validation response.
properties:
account_id:
description: Your AWS Account ID without dashes.
example: "123456789012"
type: string
issues:
$ref: "#/components/schemas/AWSCcmConfigValidationIssues"
required:
- account_id
- issues
type: object
AWSCcmConfigValidationResponseData:
description: AWS CCM config validation response data.
properties:
attributes:
$ref: "#/components/schemas/AWSCcmConfigValidationResponseAttributes"
id:
description: AWS CCM config validation resource identifier.
example: "ccm_config_validation"
type: string
type:
$ref: "#/components/schemas/AWSCcmConfigValidationType"
required:
- attributes
- id
- type
type: object
AWSCcmConfigValidationType:
default: "ccm_config_validation"
description: AWS CCM config validation resource type.
enum:
- ccm_config_validation
example: "ccm_config_validation"
type: string
x-enum-varnames:
- CCM_CONFIG_VALIDATION
AWSCloudAuthPersonaMappingAttributesResponse:
description: Attributes for AWS cloud authentication persona mapping response
properties:
Expand Down Expand Up @@ -107769,6 +107928,7 @@ paths:
- $ref: "#/components/parameters/ApplicationKeyFilterParameter"
- $ref: "#/components/parameters/ApplicationKeyFilterCreatedAtStartParameter"
- $ref: "#/components/parameters/ApplicationKeyFilterCreatedAtEndParameter"
- $ref: "#/components/parameters/ApplicationKeyFilterOwnedByParameter"
- $ref: "#/components/parameters/ApplicationKeyIncludeParameter"
responses:
"200":
Expand Down Expand Up @@ -128860,6 +129020,76 @@ paths:
operator: OR
permissions:
- aws_configuration_read
/api/v2/integration/aws/validate_ccm_config:
post:
description: |-
Validate a Cloud Cost Management config for an AWS account using Cost and Usage Report
(CUR) 2.0 against Datadog's ingest requirements without persisting it.
operationId: ValidateAWSCCMConfig
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
account_id: "123456789012"
bucket_name: billing
bucket_region: us-east-1
report_name: cost-and-usage-report
report_prefix: reports
type: ccm_config_validation
schema:
$ref: "#/components/schemas/AWSCcmConfigValidationRequest"
description: Validate a Cloud Cost Management config for an AWS account integration config.
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
account_id: "123456789012"
issues:
- code: EXPORT_NOT_FOUND
description: 'no CUR 2.0 export named "cost-and-usage-report" found'
id: ccm_config_validation
type: ccm_config_validation
schema:
$ref: "#/components/schemas/AWSCcmConfigValidationResponse"
description: AWS CCM Config validation result
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"403":
$ref: "#/components/responses/ForbiddenResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
"503":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Service Unavailable
summary: Validate AWS CCM config
tags:
- AWS Integration
x-codegen-request-body-name: body
"x-permission":
operator: OR
permissions:
- cloud_cost_management_read
- cloud_cost_management_write
x-unstable: |-
**Note**: This endpoint is in Preview and may be subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/integration/gcp/accounts:
get:
description: List all GCP STS-enabled service accounts configured in your Datadog account.
Expand Down
21 changes: 21 additions & 0 deletions examples/v2/aws-integration/ValidateAWSCCMConfig.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Validate AWS CCM config returns "AWS CCM Config validation result" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.validate_awsccm_config".to_sym] = true
end
api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new

body = DatadogAPIClient::V2::AWSCcmConfigValidationRequest.new({
data: DatadogAPIClient::V2::AWSCcmConfigValidationRequestData.new({
attributes: DatadogAPIClient::V2::AWSCcmConfigValidationRequestAttributes.new({
account_id: "123456789012",
bucket_name: "billing",
bucket_region: "us-east-1",
report_name: "cost-and-usage-report",
report_prefix: "reports",
}),
type: DatadogAPIClient::V2::AWSCcmConfigValidationType::CCM_CONFIG_VALIDATION,
}),
})
p api_instance.validate_awsccm_config(body)
4 changes: 4 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,7 @@
"filter" => "String",
"filter_created_at_start" => "String",
"filter_created_at_end" => "String",
"filter_owned_by" => "String",
"include" => "String",
},
"v2.DeleteApplicationKey" => {
Expand Down Expand Up @@ -3393,6 +3394,9 @@
"v2.CreateAWSEventBridgeSource" => {
"body" => "AWSEventBridgeCreateRequest",
},
"v2.ValidateAWSCCMConfig" => {
"body" => "AWSCcmConfigValidationRequest",
},
"v2.CreateGCPSTSAccount" => {
"body" => "GCPSTSServiceAccountCreateRequest",
},
Expand Down
16 changes: 16 additions & 0 deletions features/v2/aws_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,19 @@ Feature: AWS Integration
And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/aws-integrations
Scenario: Validate AWS CCM config returns "AWS CCM Config validation result" response
Given operation "ValidateAWSCCMConfig" enabled
And new "ValidateAWSCCMConfig" request
And body with value {"data": {"attributes": {"account_id": "123456789012", "bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports"}, "type": "ccm_config_validation"}}
When the request is sent
Then the response status is 200 AWS CCM Config validation result

@generated @skip @team:DataDog/aws-integrations
Scenario: Validate AWS CCM config returns "Bad Request" response
Given operation "ValidateAWSCCMConfig" enabled
And new "ValidateAWSCCMConfig" request
And body with value {"data": {"attributes": {"account_id": "123456789012", "bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports"}, "type": "ccm_config_validation"}}
When the request is sent
Then the response status is 400 Bad Request
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3193,6 +3193,12 @@
"type": "safe"
}
},
"ValidateAWSCCMConfig": {
"tag": "AWS Integration",
"undo": {
"type": "safe"
}
},
"ListGCPSTSAccounts": {
"tag": "GCP Integration",
"undo": {
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ def initialize
"v2.delete_aws_account_ccm_config": false,
"v2.get_aws_account_ccm_config": false,
"v2.update_aws_account_ccm_config": false,
"v2.validate_awsccm_config": false,
"v2.create_jira_issue_template": false,
"v2.delete_jira_account": false,
"v2.delete_jira_issue_template": false,
Expand Down
9 changes: 9 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,15 @@ def overrides
"v2.aws_ccm_config_response_attributes" => "AWSCcmConfigResponseAttributes",
"v2.aws_ccm_config_response_data" => "AWSCcmConfigResponseData",
"v2.aws_ccm_config_type" => "AWSCcmConfigType",
"v2.aws_ccm_config_validation_issue" => "AWSCcmConfigValidationIssue",
"v2.aws_ccm_config_validation_issue_code" => "AWSCcmConfigValidationIssueCode",
"v2.aws_ccm_config_validation_request" => "AWSCcmConfigValidationRequest",
"v2.aws_ccm_config_validation_request_attributes" => "AWSCcmConfigValidationRequestAttributes",
"v2.aws_ccm_config_validation_request_data" => "AWSCcmConfigValidationRequestData",
"v2.aws_ccm_config_validation_response" => "AWSCcmConfigValidationResponse",
"v2.aws_ccm_config_validation_response_attributes" => "AWSCcmConfigValidationResponseAttributes",
"v2.aws_ccm_config_validation_response_data" => "AWSCcmConfigValidationResponseData",
"v2.aws_ccm_config_validation_type" => "AWSCcmConfigValidationType",
"v2.aws_cloud_auth_persona_mapping_attributes_response" => "AWSCloudAuthPersonaMappingAttributesResponse",
"v2.aws_cloud_auth_persona_mapping_create_attributes" => "AWSCloudAuthPersonaMappingCreateAttributes",
"v2.aws_cloud_auth_persona_mapping_create_data" => "AWSCloudAuthPersonaMappingCreateData",
Expand Down
Loading
Loading