Skip to content

Commit d3d0c76

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6dce5e6 of spec repo
1 parent 30631e6 commit d3d0c76

16 files changed

Lines changed: 1603 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,6 +2429,158 @@ components:
24292429
type: string
24302430
x-enum-varnames:
24312431
- CCM_CONFIG
2432+
AWSCcmConfigValidationIssue:
2433+
description: A single validation issue found while validating an AWS Cost and Usage Report (CUR) 2.0 configuration.
2434+
properties:
2435+
code:
2436+
$ref: "#/components/schemas/AWSCcmConfigValidationIssueCode"
2437+
description:
2438+
description: Human-readable description of the validation issue.
2439+
example: 'no CUR 2.0 export named "cost-and-usage-report" found'
2440+
type: string
2441+
required:
2442+
- code
2443+
- description
2444+
type: object
2445+
AWSCcmConfigValidationIssueCode:
2446+
description: Identifies the specific reason a Cost and Usage Report (CUR) 2.0 configuration failed validation.
2447+
enum:
2448+
- ISSUE_CODE_UNSPECIFIED
2449+
- CREDENTIAL_ERROR
2450+
- BUCKET_NAME_INVALID_GOVCLOUD
2451+
- S3_LIST_PERMISSION_MISSING
2452+
- S3_GET_PERMISSION_MISSING
2453+
- S3_BUCKET_REGION_MISMATCH
2454+
- S3_BUCKET_NOT_ACCESSIBLE
2455+
- EXPORT_LIST_PERMISSION_MISSING
2456+
- EXPORT_GET_PERMISSION_MISSING
2457+
- EXPORT_NOT_FOUND
2458+
- EXPORT_STATUS_UNHEALTHY
2459+
- TIME_GRANULARITY_INVALID
2460+
- FILE_FORMAT_INVALID
2461+
- INCLUDE_RESOURCES_DISABLED
2462+
- REFRESH_CADENCE_INVALID
2463+
- OVERWRITE_MODE_INVALID
2464+
- QUERY_STATEMENT_INVALID
2465+
example: "EXPORT_NOT_FOUND"
2466+
type: string
2467+
x-enum-varnames:
2468+
- ISSUE_CODE_UNSPECIFIED
2469+
- CREDENTIAL_ERROR
2470+
- BUCKET_NAME_INVALID_GOVCLOUD
2471+
- S3_LIST_PERMISSION_MISSING
2472+
- S3_GET_PERMISSION_MISSING
2473+
- S3_BUCKET_REGION_MISMATCH
2474+
- S3_BUCKET_NOT_ACCESSIBLE
2475+
- EXPORT_LIST_PERMISSION_MISSING
2476+
- EXPORT_GET_PERMISSION_MISSING
2477+
- EXPORT_NOT_FOUND
2478+
- EXPORT_STATUS_UNHEALTHY
2479+
- TIME_GRANULARITY_INVALID
2480+
- FILE_FORMAT_INVALID
2481+
- INCLUDE_RESOURCES_DISABLED
2482+
- REFRESH_CADENCE_INVALID
2483+
- OVERWRITE_MODE_INVALID
2484+
- QUERY_STATEMENT_INVALID
2485+
AWSCcmConfigValidationIssues:
2486+
description: List of validation issues found for the Cost and Usage Report (CUR) 2.0 configuration. Empty when the configuration is valid.
2487+
items:
2488+
$ref: "#/components/schemas/AWSCcmConfigValidationIssue"
2489+
type: array
2490+
AWSCcmConfigValidationRequest:
2491+
description: AWS CCM config validation request body.
2492+
properties:
2493+
data:
2494+
$ref: "#/components/schemas/AWSCcmConfigValidationRequestData"
2495+
required:
2496+
- data
2497+
type: object
2498+
AWSCcmConfigValidationRequestAttributes:
2499+
description: Attributes for an AWS CCM config validation request.
2500+
properties:
2501+
account_id:
2502+
description: Your AWS Account ID without dashes.
2503+
example: "123456789012"
2504+
type: string
2505+
bucket_name:
2506+
description: Name of the S3 bucket where the Cost and Usage Report is stored.
2507+
example: "billing"
2508+
type: string
2509+
bucket_region:
2510+
description: AWS region of the S3 bucket.
2511+
example: "us-east-1"
2512+
type: string
2513+
report_name:
2514+
description: Name of the Cost and Usage Report.
2515+
example: "cost-and-usage-report"
2516+
type: string
2517+
report_prefix:
2518+
description: S3 prefix where the Cost and Usage Report is stored.
2519+
example: "reports"
2520+
type: string
2521+
required:
2522+
- account_id
2523+
- bucket_name
2524+
- bucket_region
2525+
- report_name
2526+
type: object
2527+
AWSCcmConfigValidationRequestData:
2528+
description: AWS CCM config validation request data.
2529+
properties:
2530+
attributes:
2531+
$ref: "#/components/schemas/AWSCcmConfigValidationRequestAttributes"
2532+
type:
2533+
$ref: "#/components/schemas/AWSCcmConfigValidationType"
2534+
required:
2535+
- attributes
2536+
- type
2537+
type: object
2538+
AWSCcmConfigValidationResponse:
2539+
description: AWS CCM config validation response body.
2540+
properties:
2541+
data:
2542+
$ref: "#/components/schemas/AWSCcmConfigValidationResponseData"
2543+
required:
2544+
- data
2545+
type: object
2546+
AWSCcmConfigValidationResponseAttributes:
2547+
description: Attributes for an AWS CCM config validation response.
2548+
properties:
2549+
account_id:
2550+
description: Your AWS Account ID without dashes.
2551+
example: "123456789012"
2552+
type: string
2553+
issues:
2554+
$ref: "#/components/schemas/AWSCcmConfigValidationIssues"
2555+
required:
2556+
- account_id
2557+
- issues
2558+
type: object
2559+
AWSCcmConfigValidationResponseData:
2560+
description: AWS CCM config validation response data.
2561+
properties:
2562+
attributes:
2563+
$ref: "#/components/schemas/AWSCcmConfigValidationResponseAttributes"
2564+
id:
2565+
description: AWS CCM config validation resource identifier.
2566+
example: "ccm_config_validation"
2567+
type: string
2568+
type:
2569+
$ref: "#/components/schemas/AWSCcmConfigValidationType"
2570+
required:
2571+
- attributes
2572+
- id
2573+
- type
2574+
type: object
2575+
AWSCcmConfigValidationType:
2576+
default: "ccm_config_validation"
2577+
description: AWS CCM config validation resource type.
2578+
enum:
2579+
- ccm_config_validation
2580+
example: "ccm_config_validation"
2581+
type: string
2582+
x-enum-varnames:
2583+
- CCM_CONFIG_VALIDATION
24322584
AWSCloudAuthPersonaMappingAttributesResponse:
24332585
description: Attributes for AWS cloud authentication persona mapping response
24342586
properties:
@@ -120971,6 +121123,76 @@ paths:
120971121123
operator: OR
120972121124
permissions:
120973121125
- aws_configuration_read
121126+
/api/v2/integration/aws/validate_ccm_config:
121127+
post:
121128+
description: |-
121129+
Validate a Cloud Cost Management config for an AWS account using Cost and Usage Report
121130+
(CUR) 2.0 against Datadog's ingest requirements without persisting it.
121131+
operationId: ValidateAWSCCMConfig
121132+
requestBody:
121133+
content:
121134+
application/json:
121135+
examples:
121136+
default:
121137+
value:
121138+
data:
121139+
attributes:
121140+
account_id: "123456789012"
121141+
bucket_name: billing
121142+
bucket_region: us-east-1
121143+
report_name: cost-and-usage-report
121144+
report_prefix: reports
121145+
type: ccm_config_validation
121146+
schema:
121147+
$ref: "#/components/schemas/AWSCcmConfigValidationRequest"
121148+
description: Validate a Cloud Cost Management config for an AWS account integration config.
121149+
required: true
121150+
responses:
121151+
"200":
121152+
content:
121153+
application/json:
121154+
examples:
121155+
default:
121156+
value:
121157+
data:
121158+
attributes:
121159+
account_id: "123456789012"
121160+
issues:
121161+
- code: EXPORT_NOT_FOUND
121162+
description: 'no CUR 2.0 export named "cost-and-usage-report" found'
121163+
id: ccm_config_validation
121164+
type: ccm_config_validation
121165+
schema:
121166+
$ref: "#/components/schemas/AWSCcmConfigValidationResponse"
121167+
description: AWS CCM Config validation result
121168+
"400":
121169+
content:
121170+
application/json:
121171+
schema:
121172+
$ref: "#/components/schemas/JSONAPIErrorResponse"
121173+
description: Bad Request
121174+
"403":
121175+
$ref: "#/components/responses/ForbiddenResponse"
121176+
"429":
121177+
$ref: "#/components/responses/TooManyRequestsResponse"
121178+
"503":
121179+
content:
121180+
application/json:
121181+
schema:
121182+
$ref: "#/components/schemas/JSONAPIErrorResponse"
121183+
description: Service Unavailable
121184+
summary: Validate AWS CCM config
121185+
tags:
121186+
- AWS Integration
121187+
x-codegen-request-body-name: body
121188+
"x-permission":
121189+
operator: OR
121190+
permissions:
121191+
- cloud_cost_management_read
121192+
- cloud_cost_management_write
121193+
x-unstable: |-
121194+
**Note**: This endpoint is in Preview and may be subject to change.
121195+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
120974121196
/api/v2/integration/gcp/accounts:
120975121197
get:
120976121198
description: List all GCP STS-enabled service accounts configured in your Datadog account.

api/datadog/configuration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ func NewConfiguration() *Configuration {
934934
"v2.DeleteAWSAccountCCMConfig": false,
935935
"v2.GetAWSAccountCCMConfig": false,
936936
"v2.UpdateAWSAccountCCMConfig": false,
937+
"v2.ValidateAWSCCMConfig": false,
937938
"v2.CreateJiraIssueTemplate": false,
938939
"v2.DeleteJiraAccount": false,
939940
"v2.DeleteJiraIssueTemplate": false,

api/datadogV2/api_aws_integration.go

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,105 @@ func (a *AWSIntegrationApi) UpdateAWSAccountCCMConfig(ctx _context.Context, awsA
13991399
return localVarReturnValue, localVarHTTPResponse, nil
14001400
}
14011401

1402+
// ValidateAWSCCMConfig Validate AWS CCM config.
1403+
// Validate a Cloud Cost Management config for an AWS account using Cost and Usage Report
1404+
// (CUR) 2.0 against Datadog's ingest requirements without persisting it.
1405+
func (a *AWSIntegrationApi) ValidateAWSCCMConfig(ctx _context.Context, body AWSCcmConfigValidationRequest) (AWSCcmConfigValidationResponse, *_nethttp.Response, error) {
1406+
var (
1407+
localVarHTTPMethod = _nethttp.MethodPost
1408+
localVarPostBody interface{}
1409+
localVarReturnValue AWSCcmConfigValidationResponse
1410+
)
1411+
1412+
operationId := "v2.ValidateAWSCCMConfig"
1413+
isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId)
1414+
if !isOperationEnabled {
1415+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
1416+
}
1417+
if isOperationEnabled && a.Client.Cfg.Debug {
1418+
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
1419+
}
1420+
1421+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AWSIntegrationApi.ValidateAWSCCMConfig")
1422+
if err != nil {
1423+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
1424+
}
1425+
1426+
localVarPath := localBasePath + "/api/v2/integration/aws/validate_ccm_config"
1427+
1428+
localVarHeaderParams := make(map[string]string)
1429+
localVarQueryParams := _neturl.Values{}
1430+
localVarFormParams := _neturl.Values{}
1431+
localVarHeaderParams["Content-Type"] = "application/json"
1432+
localVarHeaderParams["Accept"] = "application/json"
1433+
1434+
// body params
1435+
localVarPostBody = &body
1436+
if a.Client.Cfg.DelegatedTokenConfig != nil {
1437+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
1438+
if err != nil {
1439+
return localVarReturnValue, nil, err
1440+
}
1441+
} else {
1442+
datadog.SetAuthKeys(
1443+
ctx,
1444+
&localVarHeaderParams,
1445+
[2]string{"apiKeyAuth", "DD-API-KEY"},
1446+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
1447+
)
1448+
}
1449+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
1450+
if err != nil {
1451+
return localVarReturnValue, nil, err
1452+
}
1453+
1454+
localVarHTTPResponse, err := a.Client.CallAPI(req)
1455+
if err != nil || localVarHTTPResponse == nil {
1456+
return localVarReturnValue, localVarHTTPResponse, err
1457+
}
1458+
1459+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
1460+
if err != nil {
1461+
return localVarReturnValue, localVarHTTPResponse, err
1462+
}
1463+
1464+
if localVarHTTPResponse.StatusCode >= 300 {
1465+
newErr := datadog.GenericOpenAPIError{
1466+
ErrorBody: localVarBody,
1467+
ErrorMessage: localVarHTTPResponse.Status,
1468+
}
1469+
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 503 {
1470+
var v JSONAPIErrorResponse
1471+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1472+
if err != nil {
1473+
return localVarReturnValue, localVarHTTPResponse, newErr
1474+
}
1475+
newErr.ErrorModel = v
1476+
return localVarReturnValue, localVarHTTPResponse, newErr
1477+
}
1478+
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {
1479+
var v APIErrorResponse
1480+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1481+
if err != nil {
1482+
return localVarReturnValue, localVarHTTPResponse, newErr
1483+
}
1484+
newErr.ErrorModel = v
1485+
}
1486+
return localVarReturnValue, localVarHTTPResponse, newErr
1487+
}
1488+
1489+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1490+
if err != nil {
1491+
newErr := datadog.GenericOpenAPIError{
1492+
ErrorBody: localVarBody,
1493+
ErrorMessage: err.Error(),
1494+
}
1495+
return localVarReturnValue, localVarHTTPResponse, newErr
1496+
}
1497+
1498+
return localVarReturnValue, localVarHTTPResponse, nil
1499+
}
1500+
14021501
// NewAWSIntegrationApi Returns NewAWSIntegrationApi.
14031502
func NewAWSIntegrationApi(client *datadog.APIClient) *AWSIntegrationApi {
14041503
return &AWSIntegrationApi{

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
// - [AWSIntegrationApi.ListAWSNamespaces]
3333
// - [AWSIntegrationApi.UpdateAWSAccount]
3434
// - [AWSIntegrationApi.UpdateAWSAccountCCMConfig]
35+
// - [AWSIntegrationApi.ValidateAWSCCMConfig]
3536
// - [AWSLogsIntegrationApi.ListAWSLogsServices]
3637
// - [ActionConnectionApi.CreateActionConnection]
3738
// - [ActionConnectionApi.DeleteActionConnection]

0 commit comments

Comments
 (0)