Skip to content

Commit a7d200b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 12253da of spec repo (#3575)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 89ea222 commit a7d200b

16 files changed

Lines changed: 1320 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4062,6 +4062,86 @@ components:
40624062
type: string
40634063
type: array
40644064
type: object
4065+
AccountFilters:
4066+
description: The account filters for a cloud account.
4067+
properties:
4068+
attributes:
4069+
$ref: "#/components/schemas/AccountFiltersAttributes"
4070+
id:
4071+
description: The ID of the cloud account.
4072+
example: "123456789123"
4073+
type: string
4074+
type:
4075+
$ref: "#/components/schemas/AccountFiltersType"
4076+
required:
4077+
- attributes
4078+
- type
4079+
type: object
4080+
AccountFiltersAttributes:
4081+
description: Attributes for the account filters of a cloud account.
4082+
properties:
4083+
account_filters:
4084+
$ref: "#/components/schemas/AccountFilteringConfig"
4085+
account_id:
4086+
description: The cloud account ID.
4087+
example: "123456789123"
4088+
type: string
4089+
cloud:
4090+
description: The cloud provider of the account, for example `aws`, `aws_cur2`, or `oci`.
4091+
example: "aws_cur2"
4092+
type: string
4093+
type: object
4094+
AccountFiltersPatchData:
4095+
description: Account filters patch data.
4096+
properties:
4097+
attributes:
4098+
$ref: "#/components/schemas/AccountFiltersPatchRequestAttributes"
4099+
type:
4100+
$ref: "#/components/schemas/AccountFiltersPatchRequestType"
4101+
required:
4102+
- attributes
4103+
- type
4104+
type: object
4105+
AccountFiltersPatchRequest:
4106+
description: Account filters patch request.
4107+
properties:
4108+
data:
4109+
$ref: "#/components/schemas/AccountFiltersPatchData"
4110+
required:
4111+
- data
4112+
type: object
4113+
AccountFiltersPatchRequestAttributes:
4114+
description: Attributes for an account filters patch request.
4115+
properties:
4116+
account_filters:
4117+
$ref: "#/components/schemas/AccountFilteringConfig"
4118+
required:
4119+
- account_filters
4120+
type: object
4121+
AccountFiltersPatchRequestType:
4122+
default: account_filters_patch_request
4123+
description: Type of account filters patch request.
4124+
enum:
4125+
- account_filters_patch_request
4126+
example: account_filters_patch_request
4127+
type: string
4128+
x-enum-varnames:
4129+
- ACCOUNT_FILTERS_PATCH_REQUEST
4130+
AccountFiltersResponse:
4131+
description: Response containing the account filters for a cloud account.
4132+
properties:
4133+
data:
4134+
$ref: "#/components/schemas/AccountFilters"
4135+
type: object
4136+
AccountFiltersType:
4137+
default: account_filters
4138+
description: Type of account filters.
4139+
enum:
4140+
- account_filters
4141+
example: account_filters
4142+
type: string
4143+
x-enum-varnames:
4144+
- ACCOUNT_FILTERS
40654145
ActionConnectionAttributes:
40664146
description: The definition of `ActionConnectionAttributes` object.
40674147
properties:
@@ -126466,6 +126546,182 @@ paths:
126466126546
"x-permission":
126467126547
operator: OPEN
126468126548
permissions: []
126549+
/api/v2/cost/account_filters/{cloud_account_id}:
126550+
get:
126551+
description: Get the account filters for a cloud account (AWS CUR 1.0/2.0, OCI, and other clouds).
126552+
operationId: GetCostAccountFilters
126553+
parameters:
126554+
- $ref: "#/components/parameters/CloudAccountID"
126555+
responses:
126556+
"200":
126557+
content:
126558+
application/json:
126559+
examples:
126560+
default:
126561+
summary: Include new accounts and exclude specific accounts
126562+
value:
126563+
data:
126564+
attributes:
126565+
account_filters:
126566+
excluded_accounts:
126567+
- "123456789123"
126568+
- "123456789143"
126569+
include_new_accounts: true
126570+
account_id: "123456789123"
126571+
cloud: aws_cur2
126572+
id: "123"
126573+
type: account_filters
126574+
include_accounts:
126575+
summary: Exclude new accounts and include specific accounts
126576+
value:
126577+
data:
126578+
attributes:
126579+
account_filters:
126580+
include_new_accounts: false
126581+
included_accounts:
126582+
- "123456789123"
126583+
- "123456789143"
126584+
account_id: "123456789123"
126585+
cloud: aws_cur2
126586+
id: "123"
126587+
type: account_filters
126588+
schema:
126589+
$ref: "#/components/schemas/AccountFiltersResponse"
126590+
description: OK
126591+
"400":
126592+
content:
126593+
application/json:
126594+
schema:
126595+
$ref: "#/components/schemas/APIErrorResponse"
126596+
description: Bad Request
126597+
"403":
126598+
content:
126599+
application/json:
126600+
schema:
126601+
$ref: "#/components/schemas/APIErrorResponse"
126602+
description: Forbidden
126603+
"404":
126604+
content:
126605+
application/json:
126606+
schema:
126607+
$ref: "#/components/schemas/APIErrorResponse"
126608+
description: Not Found
126609+
"429":
126610+
$ref: "#/components/responses/TooManyRequestsResponse"
126611+
security:
126612+
- apiKeyAuth: []
126613+
appKeyAuth: []
126614+
- AuthZ:
126615+
- cloud_cost_management_read
126616+
summary: Get account filters
126617+
tags:
126618+
- Cloud Cost Management
126619+
"x-permission":
126620+
operator: OR
126621+
permissions:
126622+
- cloud_cost_management_read
126623+
patch:
126624+
description: Update the account filters for a cloud account (AWS CUR 1.0/2.0, OCI, and other clouds).
126625+
operationId: UpdateCostAccountFilters
126626+
parameters:
126627+
- $ref: "#/components/parameters/CloudAccountID"
126628+
requestBody:
126629+
content:
126630+
application/json:
126631+
examples:
126632+
default:
126633+
summary: Exclude new accounts and include specific accounts
126634+
value:
126635+
data:
126636+
attributes:
126637+
account_filters:
126638+
include_new_accounts: false
126639+
included_accounts:
126640+
- "123456789123"
126641+
- "123456789143"
126642+
type: account_filters_patch_request
126643+
exclude_accounts:
126644+
summary: Include new accounts and exclude specific accounts
126645+
value:
126646+
data:
126647+
attributes:
126648+
account_filters:
126649+
excluded_accounts:
126650+
- "123456789123"
126651+
- "123456789143"
126652+
include_new_accounts: true
126653+
type: account_filters_patch_request
126654+
schema:
126655+
$ref: "#/components/schemas/AccountFiltersPatchRequest"
126656+
required: true
126657+
responses:
126658+
"200":
126659+
content:
126660+
application/json:
126661+
examples:
126662+
default:
126663+
summary: Exclude new accounts and include specific accounts
126664+
value:
126665+
data:
126666+
attributes:
126667+
account_filters:
126668+
include_new_accounts: false
126669+
included_accounts:
126670+
- "123456789123"
126671+
- "123456789143"
126672+
account_id: "123456789123"
126673+
cloud: aws_cur2
126674+
id: "123"
126675+
type: account_filters
126676+
exclude_accounts:
126677+
summary: Include new accounts and exclude specific accounts
126678+
value:
126679+
data:
126680+
attributes:
126681+
account_filters:
126682+
excluded_accounts:
126683+
- "123456789123"
126684+
- "123456789143"
126685+
include_new_accounts: true
126686+
account_id: "123456789123"
126687+
cloud: aws_cur2
126688+
id: "123"
126689+
type: account_filters
126690+
schema:
126691+
$ref: "#/components/schemas/AccountFiltersResponse"
126692+
description: OK
126693+
"400":
126694+
content:
126695+
application/json:
126696+
schema:
126697+
$ref: "#/components/schemas/APIErrorResponse"
126698+
description: Bad Request
126699+
"403":
126700+
content:
126701+
application/json:
126702+
schema:
126703+
$ref: "#/components/schemas/APIErrorResponse"
126704+
description: Forbidden
126705+
"404":
126706+
content:
126707+
application/json:
126708+
schema:
126709+
$ref: "#/components/schemas/APIErrorResponse"
126710+
description: Not Found
126711+
"429":
126712+
$ref: "#/components/responses/TooManyRequestsResponse"
126713+
security:
126714+
- apiKeyAuth: []
126715+
appKeyAuth: []
126716+
- AuthZ:
126717+
- cloud_cost_management_write
126718+
summary: Update account filters
126719+
tags:
126720+
- Cloud Cost Management
126721+
"x-permission":
126722+
operator: OR
126723+
permissions:
126724+
- cloud_cost_management_write
126469126725
/api/v2/cost/anomalies:
126470126726
get:
126471126727
description: List detected Cloud Cost Management anomalies for the organization.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Get account filters returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
5+
p api_instance.get_cost_account_filters(9223372036854775807)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Update account filters returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
5+
6+
body = DatadogAPIClient::V2::AccountFiltersPatchRequest.new({
7+
data: DatadogAPIClient::V2::AccountFiltersPatchData.new({
8+
attributes: DatadogAPIClient::V2::AccountFiltersPatchRequestAttributes.new({
9+
account_filters: DatadogAPIClient::V2::AccountFilteringConfig.new({
10+
excluded_accounts: [
11+
"123456789123",
12+
"123456789143",
13+
],
14+
include_new_accounts: true,
15+
included_accounts: [
16+
"123456789123",
17+
"123456789143",
18+
],
19+
}),
20+
}),
21+
type: DatadogAPIClient::V2::AccountFiltersPatchRequestType::ACCOUNT_FILTERS_PATCH_REQUEST,
22+
}),
23+
})
24+
p api_instance.update_cost_account_filters(9223372036854775807, body)

features/scenarios_model_mapping.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,6 +2661,13 @@
26612661
"page_size" => "Integer",
26622662
"page_cursor" => "String",
26632663
},
2664+
"v2.GetCostAccountFilters" => {
2665+
"cloud_account_id" => "Integer",
2666+
},
2667+
"v2.UpdateCostAccountFilters" => {
2668+
"cloud_account_id" => "Integer",
2669+
"body" => "AccountFiltersPatchRequest",
2670+
},
26642671
"v2.ListCostAnomalies" => {
26652672
"start" => "Integer",
26662673
"_end" => "Integer",

features/v2/cloud_cost_management.feature

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,27 @@ Feature: Cloud Cost Management
408408
And the response "data.type" is equal to "ruleset"
409409
And the response "data.attributes.name" is equal to "EVP Cost Tags"
410410

411+
@generated @skip @team:DataDog/cloud-cost-management
412+
Scenario: Get account filters returns "Bad Request" response
413+
Given new "GetCostAccountFilters" request
414+
And request contains "cloud_account_id" parameter from "REPLACE.ME"
415+
When the request is sent
416+
Then the response status is 400 Bad Request
417+
418+
@generated @skip @team:DataDog/cloud-cost-management
419+
Scenario: Get account filters returns "Not Found" response
420+
Given new "GetCostAccountFilters" request
421+
And request contains "cloud_account_id" parameter from "REPLACE.ME"
422+
When the request is sent
423+
Then the response status is 404 Not Found
424+
425+
@generated @skip @team:DataDog/cloud-cost-management
426+
Scenario: Get account filters returns "OK" response
427+
Given new "GetCostAccountFilters" request
428+
And request contains "cloud_account_id" parameter from "REPLACE.ME"
429+
When the request is sent
430+
Then the response status is 200 OK
431+
411432
@generated @skip @team:DataDog/cloud-cost-management
412433
Scenario: Get budget returns "Bad Request" response
413434
Given new "GetBudget" request
@@ -962,6 +983,30 @@ Feature: Cloud Cost Management
962983
Then the response status is 200 OK
963984
And the response "data.attributes.account_id" is equal to "123456_A123BC_12AB34"
964985

986+
@generated @skip @team:DataDog/cloud-cost-management
987+
Scenario: Update account filters returns "Bad Request" response
988+
Given new "UpdateCostAccountFilters" request
989+
And request contains "cloud_account_id" parameter from "REPLACE.ME"
990+
And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}}, "type": "account_filters_patch_request"}}
991+
When the request is sent
992+
Then the response status is 400 Bad Request
993+
994+
@generated @skip @team:DataDog/cloud-cost-management
995+
Scenario: Update account filters returns "Not Found" response
996+
Given new "UpdateCostAccountFilters" request
997+
And request contains "cloud_account_id" parameter from "REPLACE.ME"
998+
And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}}, "type": "account_filters_patch_request"}}
999+
When the request is sent
1000+
Then the response status is 404 Not Found
1001+
1002+
@generated @skip @team:DataDog/cloud-cost-management
1003+
Scenario: Update account filters returns "OK" response
1004+
Given new "UpdateCostAccountFilters" request
1005+
And request contains "cloud_account_id" parameter from "REPLACE.ME"
1006+
And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}}, "type": "account_filters_patch_request"}}
1007+
When the request is sent
1008+
Then the response status is 200 OK
1009+
9651010
@replay-only @team:DataDog/cloud-cost-management
9661011
Scenario: Update custom allocation rule returns "OK" response
9671012
Given new "UpdateCustomAllocationRule" request

features/v2/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,18 @@
16221622
"type": "safe"
16231623
}
16241624
},
1625+
"GetCostAccountFilters": {
1626+
"tag": "Cloud Cost Management",
1627+
"undo": {
1628+
"type": "safe"
1629+
}
1630+
},
1631+
"UpdateCostAccountFilters": {
1632+
"tag": "Cloud Cost Management",
1633+
"undo": {
1634+
"type": "idempotent"
1635+
}
1636+
},
16251637
"ListCostAnomalies": {
16261638
"tag": "Cloud Cost Management",
16271639
"undo": {

0 commit comments

Comments
 (0)