Skip to content

Commit 79c7c38

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 33fde41 of spec repo
1 parent 5c6f8ac commit 79c7c38

17 files changed

Lines changed: 898 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16658,6 +16658,76 @@ components:
1665816658
type: string
1665916659
x-enum-varnames:
1666016660
- COST_BY_ORG
16661+
CostRecommendationArray:
16662+
description: A page of cost recommendations with pagination metadata.
16663+
properties:
16664+
data:
16665+
description: The list of cost recommendations on this page.
16666+
items:
16667+
$ref: "#/components/schemas/CostRecommendationData"
16668+
type: array
16669+
meta:
16670+
$ref: "#/components/schemas/RecommendationsPageMeta"
16671+
required:
16672+
- data
16673+
type: object
16674+
CostRecommendationData:
16675+
description: A single cost recommendation entry in JSON:API form.
16676+
properties:
16677+
attributes:
16678+
$ref: "#/components/schemas/CostRecommendationDataAttributes"
16679+
id:
16680+
description: Unique identifier for the recommendation.
16681+
type: string
16682+
type:
16683+
$ref: "#/components/schemas/CostRecommendationDataType"
16684+
required:
16685+
- type
16686+
type: object
16687+
CostRecommendationDataAttributes:
16688+
description: Attributes describing a single cost recommendation.
16689+
properties:
16690+
dd_resource_key:
16691+
description: Datadog resource key identifying the recommended resource.
16692+
type: string
16693+
potential_daily_savings:
16694+
$ref: "#/components/schemas/CostRecommendationDataAttributesPotentialDailySavings"
16695+
recommendation_type:
16696+
description: The kind of recommendation (for example, `terminate` or `rightsize`).
16697+
type: string
16698+
resource_id:
16699+
description: Cloud provider identifier of the resource.
16700+
type: string
16701+
resource_type:
16702+
description: Resource type (for example, `aws_ec2_instance`).
16703+
type: string
16704+
tags:
16705+
description: Tags attached to the recommended resource.
16706+
items:
16707+
description: A single resource tag.
16708+
type: string
16709+
type: array
16710+
type: object
16711+
CostRecommendationDataAttributesPotentialDailySavings:
16712+
description: Estimated daily savings if the recommendation is applied.
16713+
properties:
16714+
amount:
16715+
description: Numeric amount of the potential daily savings.
16716+
format: double
16717+
type: number
16718+
currency:
16719+
description: ISO 4217 currency code for the savings amount.
16720+
type: string
16721+
type: object
16722+
CostRecommendationDataType:
16723+
default: recommendation
16724+
description: Recommendation resource type.
16725+
enum:
16726+
- recommendation
16727+
example: recommendation
16728+
type: string
16729+
x-enum-varnames:
16730+
- RECOMMENDATION
1666116731
CostTag:
1666216732
description: A Cloud Cost Management tag.
1666316733
properties:
@@ -59359,6 +59429,64 @@ components:
5935959429
type: string
5936059430
x-enum-varnames:
5936159431
- RECOMMENDATION
59432+
RecommendationsFilterRequest:
59433+
description: Request body for filtering cost recommendations.
59434+
example:
59435+
filter: "@resource_table:aws_ec2_instance"
59436+
sort:
59437+
- expression: potential_daily_savings.amount
59438+
order: DESC
59439+
properties:
59440+
filter:
59441+
description: Filter expression applied to the recommendations.
59442+
type: string
59443+
scope:
59444+
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
59445+
type: string
59446+
sort:
59447+
description: Ordered list of sort clauses applied to the result set.
59448+
items:
59449+
$ref: "#/components/schemas/RecommendationsFilterRequestSortItems"
59450+
type: array
59451+
view:
59452+
description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`).
59453+
type: string
59454+
type: object
59455+
RecommendationsFilterRequestSortItems:
59456+
description: A single sort clause applied to the cost recommendations result set.
59457+
properties:
59458+
expression:
59459+
description: Field to sort by (for example, `potential_daily_savings.amount`).
59460+
type: string
59461+
order:
59462+
description: Sort direction, either `ASC` or `DESC`.
59463+
type: string
59464+
type: object
59465+
RecommendationsPageMeta:
59466+
description: Top-level JSON:API meta object for paginated cost recommendation responses.
59467+
properties:
59468+
page:
59469+
$ref: "#/components/schemas/RecommendationsPageMetaPage"
59470+
type: object
59471+
RecommendationsPageMetaPage:
59472+
description: Pagination metadata for a page of cost recommendations.
59473+
properties:
59474+
filter:
59475+
description: The filter expression that was applied to produce this page.
59476+
type: string
59477+
next_page_token:
59478+
description: Opaque token used to fetch the next page; absent on the last page.
59479+
type: string
59480+
page_size:
59481+
description: Number of items returned in this page (1–10000).
59482+
format: int32
59483+
maximum: 10000
59484+
minimum: 1
59485+
type: integer
59486+
page_token:
59487+
description: Pagination token echoed back from the request.
59488+
type: string
59489+
type: object
5936259490
ReferenceTableCreateSourceType:
5936359491
description: The source type for creating reference table data. Only these source types can be created through this API.
5936459492
enum:
@@ -99856,6 +99984,76 @@ paths:
9985699984
operator: OR
9985799985
permissions:
9985899986
- cloud_cost_management_read
99987+
/api/v2/cost/recommendations:
99988+
post:
99989+
description: List cost recommendations matching a filter, with pagination and sorting.
99990+
operationId: GetRecommendationsByFilter
99991+
parameters:
99992+
- description: Number of results per page (1–10000).
99993+
in: query
99994+
name: page[size]
99995+
schema:
99996+
type: string
99997+
- description: Pagination token from a previous response.
99998+
in: query
99999+
name: page[token]
100000+
schema:
100001+
type: string
100002+
requestBody:
100003+
content:
100004+
application/json:
100005+
examples:
100006+
default:
100007+
value:
100008+
filter: "@resource_table:aws_ec2_instance"
100009+
sort:
100010+
- expression: potential_daily_savings.amount
100011+
order: DESC
100012+
schema:
100013+
$ref: "#/components/schemas/RecommendationsFilterRequest"
100014+
required: true
100015+
responses:
100016+
"200":
100017+
content:
100018+
application/json:
100019+
examples:
100020+
default:
100021+
value:
100022+
data:
100023+
- attributes:
100024+
dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"
100025+
potential_daily_savings:
100026+
amount: 1.23
100027+
currency: USD
100028+
recommendation_type: terminate
100029+
resource_id: i-1234567890abcdef0
100030+
resource_type: aws_ec2_instance
100031+
tags:
100032+
- "env:prod"
100033+
- "team:ccm"
100034+
id: encoded-event-id-1
100035+
type: recommendation
100036+
meta:
100037+
page:
100038+
filter: "@resource_table:aws_ec2_instance"
100039+
next_page_token: ""
100040+
page_size: 100
100041+
schema:
100042+
$ref: "#/components/schemas/CostRecommendationArray"
100043+
description: OK
100044+
"429":
100045+
$ref: "#/components/responses/TooManyRequestsResponse"
100046+
security:
100047+
- apiKeyAuth: []
100048+
appKeyAuth: []
100049+
- AuthZ:
100050+
- cloud_cost_management_read
100051+
summary: Get recommendations by filter
100052+
tags:
100053+
- Cloud Cost Management
100054+
x-unstable: |-
100055+
**Note**: This endpoint is in preview and is subject to change.
100056+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
99859100057
/api/v2/cost/tag_descriptions:
99860100058
get:
99861100059
description: List Cloud Cost Management tag key descriptions for the organization. Use `filter[cloud]` to scope the result to a single cloud provider; when omitted, both cross-cloud defaults and cloud-specific descriptions are returned.

docs/datadog_api_client.v2.model.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6535,6 +6535,41 @@ datadog\_api\_client.v2.model.cost\_by\_org\_type module
65356535
:members:
65366536
:show-inheritance:
65376537

6538+
datadog\_api\_client.v2.model.cost\_recommendation\_array module
6539+
----------------------------------------------------------------
6540+
6541+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_array
6542+
:members:
6543+
:show-inheritance:
6544+
6545+
datadog\_api\_client.v2.model.cost\_recommendation\_data module
6546+
---------------------------------------------------------------
6547+
6548+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data
6549+
:members:
6550+
:show-inheritance:
6551+
6552+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_attributes module
6553+
---------------------------------------------------------------------------
6554+
6555+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_attributes
6556+
:members:
6557+
:show-inheritance:
6558+
6559+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_attributes\_potential\_daily\_savings module
6560+
------------------------------------------------------------------------------------------------------
6561+
6562+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_attributes_potential_daily_savings
6563+
:members:
6564+
:show-inheritance:
6565+
6566+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_type module
6567+
---------------------------------------------------------------------
6568+
6569+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_type
6570+
:members:
6571+
:show-inheritance:
6572+
65386573
datadog\_api\_client.v2.model.cost\_tag module
65396574
----------------------------------------------
65406575

@@ -25596,6 +25631,34 @@ datadog\_api\_client.v2.model.recommendation\_type module
2559625631
:members:
2559725632
:show-inheritance:
2559825633

25634+
datadog\_api\_client.v2.model.recommendations\_filter\_request module
25635+
---------------------------------------------------------------------
25636+
25637+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request
25638+
:members:
25639+
:show-inheritance:
25640+
25641+
datadog\_api\_client.v2.model.recommendations\_filter\_request\_sort\_items module
25642+
----------------------------------------------------------------------------------
25643+
25644+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request_sort_items
25645+
:members:
25646+
:show-inheritance:
25647+
25648+
datadog\_api\_client.v2.model.recommendations\_page\_meta module
25649+
----------------------------------------------------------------
25650+
25651+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta
25652+
:members:
25653+
:show-inheritance:
25654+
25655+
datadog\_api\_client.v2.model.recommendations\_page\_meta\_page module
25656+
----------------------------------------------------------------------
25657+
25658+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta_page
25659+
:members:
25660+
:show-inheritance:
25661+
2559925662
datadog\_api\_client.v2.model.reference\_table\_create\_source\_type module
2560025663
---------------------------------------------------------------------------
2560125664

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""
2+
Get recommendations by filter returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
7+
from datadog_api_client.v2.model.recommendations_filter_request import RecommendationsFilterRequest
8+
from datadog_api_client.v2.model.recommendations_filter_request_sort_items import RecommendationsFilterRequestSortItems
9+
10+
body = RecommendationsFilterRequest(
11+
filter="@resource_table:aws_ec2_instance",
12+
sort=[
13+
RecommendationsFilterRequestSortItems(
14+
expression="potential_daily_savings.amount",
15+
order="DESC",
16+
),
17+
],
18+
)
19+
20+
configuration = Configuration()
21+
configuration.unstable_operations["get_recommendations_by_filter"] = True
22+
with ApiClient(configuration) as api_client:
23+
api_instance = CloudCostManagementApi(api_client)
24+
response = api_instance.get_recommendations_by_filter(body=body)
25+
26+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ def __init__(
361361
"v2.get_commitments_utilization_scalar": False,
362362
"v2.get_commitments_utilization_timeseries": False,
363363
"v2.get_cost_anomaly": False,
364+
"v2.get_recommendations_by_filter": False,
364365
"v2.list_cost_anomalies": False,
365366
"v2.create_dashboard_secure_embed": False,
366367
"v2.delete_dashboard_secure_embed": False,

0 commit comments

Comments
 (0)