Skip to content

Commit ec6ffbc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update documentation with account filtering info for aws_cur_config endpoints (#2416)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 06832eb commit ec6ffbc

File tree

10 files changed

+161
-15
lines changed

10 files changed

+161
-15
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-02-20 13:34:59.325200",
8-
"spec_repo_commit": "c64543d0"
7+
"regenerated": "2025-02-20 18:33:39.071911",
8+
"spec_repo_commit": "d3fcdb89"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-20 13:34:59.340610",
13-
"spec_repo_commit": "c64543d0"
12+
"regenerated": "2025-02-20 18:33:39.118129",
13+
"spec_repo_commit": "d3fcdb89"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,33 @@ components:
17151715
xray_services:
17161716
$ref: '#/components/schemas/XRayServicesList'
17171717
type: object
1718+
AccountFilteringConfig:
1719+
description: The account filtering configuration.
1720+
properties:
1721+
excluded_accounts:
1722+
description: The AWS account IDs to be excluded from your billing dataset.
1723+
This field is used when `include_new_accounts` is `true`.
1724+
example:
1725+
- '123456789123'
1726+
- '123456789143'
1727+
items:
1728+
type: string
1729+
type: array
1730+
include_new_accounts:
1731+
description: Whether or not to automatically include new member accounts
1732+
by default in your billing dataset.
1733+
example: true
1734+
type: boolean
1735+
included_accounts:
1736+
description: The AWS account IDs to be included in your billing dataset.
1737+
This field is used when `include_new_accounts` is `false`.
1738+
example:
1739+
- '123456789123'
1740+
- '123456789143'
1741+
items:
1742+
type: string
1743+
type: array
1744+
type: object
17181745
ActionConnectionAttributes:
17191746
description: The definition of `ActionConnectionAttributes` object.
17201747
properties:
@@ -2870,6 +2897,8 @@ components:
28702897
AwsCURConfigAttributes:
28712898
description: Attributes for An AWS CUR config.
28722899
properties:
2900+
account_filters:
2901+
$ref: '#/components/schemas/AccountFilteringConfig'
28732902
account_id:
28742903
description: The AWS account ID.
28752904
example: '123456789123'
@@ -2947,12 +2976,12 @@ components:
29472976
AwsCURConfigPatchRequestAttributes:
29482977
description: Attributes for AWS CUR config Patch Request.
29492978
properties:
2979+
account_filters:
2980+
$ref: '#/components/schemas/AccountFilteringConfig'
29502981
is_enabled:
29512982
description: Whether or not the Cloud Cost Management account is enabled.
29522983
example: true
29532984
type: boolean
2954-
required:
2955-
- is_enabled
29562985
type: object
29572986
AwsCURConfigPatchRequestType:
29582987
default: aws_cur_config_patch_request
@@ -2985,6 +3014,8 @@ components:
29853014
AwsCURConfigPostRequestAttributes:
29863015
description: Attributes for AWS CUR config Post Request.
29873016
properties:
3017+
account_filters:
3018+
$ref: '#/components/schemas/AccountFilteringConfig'
29883019
account_id:
29893020
description: The AWS account ID.
29903021
example: '123456789123'
@@ -35630,7 +35661,8 @@ paths:
3563035661
permissions:
3563135662
- cloud_cost_management_write
3563235663
patch:
35633-
description: Update the status of an AWS CUR config (active/archived).
35664+
description: Update the status (active/archived) and/or account filtering configuration
35665+
of an AWS CUR config.
3563435666
operationId: UpdateCostAWSCURConfig
3563535667
parameters:
3563635668
- $ref: '#/components/parameters/CloudAccountID'

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ datadog\_api\_client.v2.model package
44
Submodules
55
----------
66

7+
datadog\_api\_client.v2.model.account\_filtering\_config module
8+
---------------------------------------------------------------
9+
10+
.. automodule:: datadog_api_client.v2.model.account_filtering_config
11+
:members:
12+
:show-inheritance:
13+
714
datadog\_api\_client.v2.model.action\_connection\_attributes module
815
-------------------------------------------------------------------
916

src/datadog_api_client/v2/api/cloud_cost_management_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def update_cost_awscur_config(
427427
) -> AwsCURConfigsResponse:
428428
"""Update Cloud Cost Management AWS CUR config.
429429
430-
Update the status of an AWS CUR config (active/archived).
430+
Update the status (active/archived) and/or account filtering configuration of an AWS CUR config.
431431
432432
:param cloud_account_id: Cloud Account id.
433433
:type cloud_account_id: str
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
class AccountFilteringConfig(ModelNormal):
17+
@cached_property
18+
def openapi_types(_):
19+
return {
20+
"excluded_accounts": ([str],),
21+
"include_new_accounts": (bool,),
22+
"included_accounts": ([str],),
23+
}
24+
25+
attribute_map = {
26+
"excluded_accounts": "excluded_accounts",
27+
"include_new_accounts": "include_new_accounts",
28+
"included_accounts": "included_accounts",
29+
}
30+
31+
def __init__(
32+
self_,
33+
excluded_accounts: Union[List[str], UnsetType] = unset,
34+
include_new_accounts: Union[bool, UnsetType] = unset,
35+
included_accounts: Union[List[str], UnsetType] = unset,
36+
**kwargs,
37+
):
38+
"""
39+
The account filtering configuration.
40+
41+
:param excluded_accounts: The AWS account IDs to be excluded from your billing dataset. This field is used when ``include_new_accounts`` is ``true``.
42+
:type excluded_accounts: [str], optional
43+
44+
:param include_new_accounts: Whether or not to automatically include new member accounts by default in your billing dataset.
45+
:type include_new_accounts: bool, optional
46+
47+
:param included_accounts: The AWS account IDs to be included in your billing dataset. This field is used when ``include_new_accounts`` is ``false``.
48+
:type included_accounts: [str], optional
49+
"""
50+
if excluded_accounts is not unset:
51+
kwargs["excluded_accounts"] = excluded_accounts
52+
if include_new_accounts is not unset:
53+
kwargs["include_new_accounts"] = include_new_accounts
54+
if included_accounts is not unset:
55+
kwargs["included_accounts"] = included_accounts
56+
super().__init__(kwargs)

src/datadog_api_client/v2/model/aws_cur_config_attributes.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import List, Union
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -13,6 +13,10 @@
1313
)
1414

1515

16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig
18+
19+
1620
class AwsCURConfigAttributes(ModelNormal):
1721
validations = {
1822
"created_at": {},
@@ -25,7 +29,10 @@ class AwsCURConfigAttributes(ModelNormal):
2529

2630
@cached_property
2731
def openapi_types(_):
32+
from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig
33+
2834
return {
35+
"account_filters": (AccountFilteringConfig,),
2936
"account_id": (str,),
3037
"bucket_name": (str,),
3138
"bucket_region": (str,),
@@ -40,6 +47,7 @@ def openapi_types(_):
4047
}
4148

4249
attribute_map = {
50+
"account_filters": "account_filters",
4351
"account_id": "account_id",
4452
"bucket_name": "bucket_name",
4553
"bucket_region": "bucket_region",
@@ -61,6 +69,7 @@ def __init__(
6169
report_name: str,
6270
report_prefix: str,
6371
status: str,
72+
account_filters: Union[AccountFilteringConfig, UnsetType] = unset,
6473
created_at: Union[str, UnsetType] = unset,
6574
error_messages: Union[List[str], UnsetType] = unset,
6675
months: Union[int, UnsetType] = unset,
@@ -71,6 +80,9 @@ def __init__(
7180
"""
7281
Attributes for An AWS CUR config.
7382
83+
:param account_filters: The account filtering configuration.
84+
:type account_filters: AccountFilteringConfig, optional
85+
7486
:param account_id: The AWS account ID.
7587
:type account_id: str
7688
@@ -104,6 +116,8 @@ def __init__(
104116
:param updated_at: The timestamp when the AWS CUR config status was updated.
105117
:type updated_at: str, optional
106118
"""
119+
if account_filters is not unset:
120+
kwargs["account_filters"] = account_filters
107121
if created_at is not unset:
108122
kwargs["created_at"] = created_at
109123
if error_messages is not unset:

src/datadog_api_client/v2/model/aws_cur_config_patch_request_attributes.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,52 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6+
from typing import Union, TYPE_CHECKING
67

78
from datadog_api_client.model_utils import (
89
ModelNormal,
910
cached_property,
11+
unset,
12+
UnsetType,
1013
)
1114

1215

16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig
18+
19+
1320
class AwsCURConfigPatchRequestAttributes(ModelNormal):
1421
@cached_property
1522
def openapi_types(_):
23+
from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig
24+
1625
return {
26+
"account_filters": (AccountFilteringConfig,),
1727
"is_enabled": (bool,),
1828
}
1929

2030
attribute_map = {
31+
"account_filters": "account_filters",
2132
"is_enabled": "is_enabled",
2233
}
2334

24-
def __init__(self_, is_enabled: bool, **kwargs):
35+
def __init__(
36+
self_,
37+
account_filters: Union[AccountFilteringConfig, UnsetType] = unset,
38+
is_enabled: Union[bool, UnsetType] = unset,
39+
**kwargs,
40+
):
2541
"""
2642
Attributes for AWS CUR config Patch Request.
2743
44+
:param account_filters: The account filtering configuration.
45+
:type account_filters: AccountFilteringConfig, optional
46+
2847
:param is_enabled: Whether or not the Cloud Cost Management account is enabled.
29-
:type is_enabled: bool
48+
:type is_enabled: bool, optional
3049
"""
50+
if account_filters is not unset:
51+
kwargs["account_filters"] = account_filters
52+
if is_enabled is not unset:
53+
kwargs["is_enabled"] = is_enabled
3154
super().__init__(kwargs)
32-
33-
self_.is_enabled = is_enabled

src/datadog_api_client/v2/model/aws_cur_config_post_request_attributes.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -13,6 +13,10 @@
1313
)
1414

1515

16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig
18+
19+
1620
class AwsCURConfigPostRequestAttributes(ModelNormal):
1721
validations = {
1822
"months": {
@@ -22,7 +26,10 @@ class AwsCURConfigPostRequestAttributes(ModelNormal):
2226

2327
@cached_property
2428
def openapi_types(_):
29+
from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig
30+
2531
return {
32+
"account_filters": (AccountFilteringConfig,),
2633
"account_id": (str,),
2734
"bucket_name": (str,),
2835
"bucket_region": (str,),
@@ -33,6 +40,7 @@ def openapi_types(_):
3340
}
3441

3542
attribute_map = {
43+
"account_filters": "account_filters",
3644
"account_id": "account_id",
3745
"bucket_name": "bucket_name",
3846
"bucket_region": "bucket_region",
@@ -48,6 +56,7 @@ def __init__(
4856
bucket_name: str,
4957
report_name: str,
5058
report_prefix: str,
59+
account_filters: Union[AccountFilteringConfig, UnsetType] = unset,
5160
bucket_region: Union[str, UnsetType] = unset,
5261
is_enabled: Union[bool, UnsetType] = unset,
5362
months: Union[int, UnsetType] = unset,
@@ -56,6 +65,9 @@ def __init__(
5665
"""
5766
Attributes for AWS CUR config Post Request.
5867
68+
:param account_filters: The account filtering configuration.
69+
:type account_filters: AccountFilteringConfig, optional
70+
5971
:param account_id: The AWS account ID.
6072
:type account_id: str
6173
@@ -77,6 +89,8 @@ def __init__(
7789
:param report_prefix: The report prefix used for the Cost and Usage Report.
7890
:type report_prefix: str
7991
"""
92+
if account_filters is not unset:
93+
kwargs["account_filters"] = account_filters
8094
if bucket_region is not unset:
8195
kwargs["bucket_region"] = bucket_region
8296
if is_enabled is not unset:

src/datadog_api_client/v2/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
from datadog_api_client.v2.model.aws_regions_include_only import AWSRegionsIncludeOnly
6363
from datadog_api_client.v2.model.aws_resources_config import AWSResourcesConfig
6464
from datadog_api_client.v2.model.aws_traces_config import AWSTracesConfig
65+
from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig
6566
from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes
6667
from datadog_api_client.v2.model.action_connection_attributes_update import ActionConnectionAttributesUpdate
6768
from datadog_api_client.v2.model.action_connection_data import ActionConnectionData
@@ -2539,6 +2540,7 @@
25392540
"AWSRegionsIncludeOnly",
25402541
"AWSResourcesConfig",
25412542
"AWSTracesConfig",
2543+
"AccountFilteringConfig",
25422544
"ActionConnectionAttributes",
25432545
"ActionConnectionAttributesUpdate",
25442546
"ActionConnectionData",

tests/v2/features/cloud_cost_management.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: Cloud Cost Management
1616
@generated @skip @team:Datadog/cloud-cost-management
1717
Scenario: Create Cloud Cost Management AWS CUR config returns "Bad Request" response
1818
Given new "CreateCostAWSCURConfig" request
19-
And body with value {"data": {"attributes": {"account_id": "123456789123", "bucket_name": "dd-cost-bucket", "bucket_region": "us-east-1", "report_name": "dd-report-name", "report_prefix": "dd-report-prefix"}, "type": "aws_cur_config_post_request"}}
19+
And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}, "account_id": "123456789123", "bucket_name": "dd-cost-bucket", "bucket_region": "us-east-1", "report_name": "dd-report-name", "report_prefix": "dd-report-prefix"}, "type": "aws_cur_config_post_request"}}
2020
When the request is sent
2121
Then the response status is 400 Bad Request
2222

0 commit comments

Comments
 (0)