Skip to content

Commit bba6e23

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 041b29a of spec repo
1 parent 014a1e7 commit bba6e23

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
@@ -2397,6 +2397,158 @@ components:
23972397
type: string
23982398
x-enum-varnames:
23992399
- CCM_CONFIG
2400+
AWSCcmConfigValidationIssue:
2401+
description: A single validation issue found while validating an AWS Cost and Usage Report (CUR) 2.0 configuration.
2402+
properties:
2403+
code:
2404+
$ref: "#/components/schemas/AWSCcmConfigValidationIssueCode"
2405+
description:
2406+
description: Human-readable description of the validation issue.
2407+
example: 'no CUR 2.0 export named "cost-and-usage-report" found'
2408+
type: string
2409+
required:
2410+
- code
2411+
- description
2412+
type: object
2413+
AWSCcmConfigValidationIssueCode:
2414+
description: Identifies the specific reason a Cost and Usage Report (CUR) 2.0 configuration failed validation.
2415+
enum:
2416+
- ISSUE_CODE_UNSPECIFIED
2417+
- CREDENTIAL_ERROR
2418+
- BUCKET_NAME_INVALID_GOVCLOUD
2419+
- S3_LIST_PERMISSION_MISSING
2420+
- S3_GET_PERMISSION_MISSING
2421+
- S3_BUCKET_REGION_MISMATCH
2422+
- S3_BUCKET_NOT_ACCESSIBLE
2423+
- EXPORT_LIST_PERMISSION_MISSING
2424+
- EXPORT_GET_PERMISSION_MISSING
2425+
- EXPORT_NOT_FOUND
2426+
- EXPORT_STATUS_UNHEALTHY
2427+
- TIME_GRANULARITY_INVALID
2428+
- FILE_FORMAT_INVALID
2429+
- INCLUDE_RESOURCES_DISABLED
2430+
- REFRESH_CADENCE_INVALID
2431+
- OVERWRITE_MODE_INVALID
2432+
- QUERY_STATEMENT_INVALID
2433+
example: "EXPORT_NOT_FOUND"
2434+
type: string
2435+
x-enum-varnames:
2436+
- ISSUE_CODE_UNSPECIFIED
2437+
- CREDENTIAL_ERROR
2438+
- BUCKET_NAME_INVALID_GOVCLOUD
2439+
- S3_LIST_PERMISSION_MISSING
2440+
- S3_GET_PERMISSION_MISSING
2441+
- S3_BUCKET_REGION_MISMATCH
2442+
- S3_BUCKET_NOT_ACCESSIBLE
2443+
- EXPORT_LIST_PERMISSION_MISSING
2444+
- EXPORT_GET_PERMISSION_MISSING
2445+
- EXPORT_NOT_FOUND
2446+
- EXPORT_STATUS_UNHEALTHY
2447+
- TIME_GRANULARITY_INVALID
2448+
- FILE_FORMAT_INVALID
2449+
- INCLUDE_RESOURCES_DISABLED
2450+
- REFRESH_CADENCE_INVALID
2451+
- OVERWRITE_MODE_INVALID
2452+
- QUERY_STATEMENT_INVALID
2453+
AWSCcmConfigValidationIssues:
2454+
description: List of validation issues found for the Cost and Usage Report (CUR) 2.0 configuration. Empty when the configuration is valid.
2455+
items:
2456+
$ref: "#/components/schemas/AWSCcmConfigValidationIssue"
2457+
type: array
2458+
AWSCcmConfigValidationRequest:
2459+
description: AWS CCM config validation request body.
2460+
properties:
2461+
data:
2462+
$ref: "#/components/schemas/AWSCcmConfigValidationRequestData"
2463+
required:
2464+
- data
2465+
type: object
2466+
AWSCcmConfigValidationRequestAttributes:
2467+
description: Attributes for an AWS CCM config validation request.
2468+
properties:
2469+
account_id:
2470+
description: Your AWS Account ID without dashes.
2471+
example: "123456789012"
2472+
type: string
2473+
bucket_name:
2474+
description: Name of the S3 bucket where the Cost and Usage Report is stored.
2475+
example: "billing"
2476+
type: string
2477+
bucket_region:
2478+
description: AWS region of the S3 bucket.
2479+
example: "us-east-1"
2480+
type: string
2481+
report_name:
2482+
description: Name of the Cost and Usage Report.
2483+
example: "cost-and-usage-report"
2484+
type: string
2485+
report_prefix:
2486+
description: S3 prefix where the Cost and Usage Report is stored.
2487+
example: "reports"
2488+
type: string
2489+
required:
2490+
- account_id
2491+
- bucket_name
2492+
- bucket_region
2493+
- report_name
2494+
type: object
2495+
AWSCcmConfigValidationRequestData:
2496+
description: AWS CCM config validation request data.
2497+
properties:
2498+
attributes:
2499+
$ref: "#/components/schemas/AWSCcmConfigValidationRequestAttributes"
2500+
type:
2501+
$ref: "#/components/schemas/AWSCcmConfigValidationType"
2502+
required:
2503+
- attributes
2504+
- type
2505+
type: object
2506+
AWSCcmConfigValidationResponse:
2507+
description: AWS CCM config validation response body.
2508+
properties:
2509+
data:
2510+
$ref: "#/components/schemas/AWSCcmConfigValidationResponseData"
2511+
required:
2512+
- data
2513+
type: object
2514+
AWSCcmConfigValidationResponseAttributes:
2515+
description: Attributes for an AWS CCM config validation response.
2516+
properties:
2517+
account_id:
2518+
description: Your AWS Account ID without dashes.
2519+
example: "123456789012"
2520+
type: string
2521+
issues:
2522+
$ref: "#/components/schemas/AWSCcmConfigValidationIssues"
2523+
required:
2524+
- account_id
2525+
- issues
2526+
type: object
2527+
AWSCcmConfigValidationResponseData:
2528+
description: AWS CCM config validation response data.
2529+
properties:
2530+
attributes:
2531+
$ref: "#/components/schemas/AWSCcmConfigValidationResponseAttributes"
2532+
id:
2533+
description: AWS CCM config validation resource identifier.
2534+
example: "ccm_config_validation"
2535+
type: string
2536+
type:
2537+
$ref: "#/components/schemas/AWSCcmConfigValidationType"
2538+
required:
2539+
- attributes
2540+
- id
2541+
- type
2542+
type: object
2543+
AWSCcmConfigValidationType:
2544+
default: "ccm_config_validation"
2545+
description: AWS CCM config validation resource type.
2546+
enum:
2547+
- ccm_config_validation
2548+
example: "ccm_config_validation"
2549+
type: string
2550+
x-enum-varnames:
2551+
- CCM_CONFIG_VALIDATION
24002552
AWSCloudAuthPersonaMappingAttributesResponse:
24012553
description: Attributes for AWS cloud authentication persona mapping response
24022554
properties:
@@ -116331,6 +116483,76 @@ paths:
116331116483
operator: OR
116332116484
permissions:
116333116485
- aws_configuration_read
116486+
/api/v2/integration/aws/validate_ccm_config:
116487+
post:
116488+
description: |-
116489+
Validate a Cloud Cost Management config for an AWS account using Cost and Usage Report
116490+
(CUR) 2.0 against Datadog's ingest requirements without persisting it.
116491+
operationId: ValidateAWSCCMConfig
116492+
requestBody:
116493+
content:
116494+
application/json:
116495+
examples:
116496+
default:
116497+
value:
116498+
data:
116499+
attributes:
116500+
account_id: "123456789012"
116501+
bucket_name: billing
116502+
bucket_region: us-east-1
116503+
report_name: cost-and-usage-report
116504+
report_prefix: reports
116505+
type: ccm_config_validation
116506+
schema:
116507+
$ref: "#/components/schemas/AWSCcmConfigValidationRequest"
116508+
description: Validate a Cloud Cost Management config for an AWS account integration config.
116509+
required: true
116510+
responses:
116511+
"200":
116512+
content:
116513+
application/json:
116514+
examples:
116515+
default:
116516+
value:
116517+
data:
116518+
attributes:
116519+
account_id: "123456789012"
116520+
issues:
116521+
- code: EXPORT_NOT_FOUND
116522+
description: 'no CUR 2.0 export named "cost-and-usage-report" found'
116523+
id: ccm_config_validation
116524+
type: ccm_config_validation
116525+
schema:
116526+
$ref: "#/components/schemas/AWSCcmConfigValidationResponse"
116527+
description: AWS CCM Config validation result
116528+
"400":
116529+
content:
116530+
application/json:
116531+
schema:
116532+
$ref: "#/components/schemas/JSONAPIErrorResponse"
116533+
description: Bad Request
116534+
"403":
116535+
$ref: "#/components/responses/ForbiddenResponse"
116536+
"429":
116537+
$ref: "#/components/responses/TooManyRequestsResponse"
116538+
"503":
116539+
content:
116540+
application/json:
116541+
schema:
116542+
$ref: "#/components/schemas/JSONAPIErrorResponse"
116543+
description: Service Unavailable
116544+
summary: Validate AWS CCM config
116545+
tags:
116546+
- AWS Integration
116547+
x-codegen-request-body-name: body
116548+
"x-permission":
116549+
operator: OR
116550+
permissions:
116551+
- cloud_cost_management_read
116552+
- cloud_cost_management_write
116553+
x-unstable: |-
116554+
**Note**: This endpoint is in Preview and may be subject to change.
116555+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
116334116556
/api/v2/integration/gcp/accounts:
116335116557
get:
116336116558
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
@@ -902,6 +902,7 @@ func NewConfiguration() *Configuration {
902902
"v2.DeleteAWSAccountCCMConfig": false,
903903
"v2.GetAWSAccountCCMConfig": false,
904904
"v2.UpdateAWSAccountCCMConfig": false,
905+
"v2.ValidateAWSCCMConfig": false,
905906
"v2.CreateJiraIssueTemplate": false,
906907
"v2.DeleteJiraAccount": false,
907908
"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)