Skip to content

Commit 088b6c8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0e18d91 of spec repo
1 parent 286ba55 commit 088b6c8

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
@@ -17831,6 +17831,76 @@ components:
1783117831
required:
1783217832
- data
1783317833
type: object
17834+
CostRecommendationArray:
17835+
description: A page of cost recommendations with pagination metadata.
17836+
properties:
17837+
data:
17838+
description: The list of cost recommendations on this page.
17839+
items:
17840+
$ref: "#/components/schemas/CostRecommendationData"
17841+
type: array
17842+
meta:
17843+
$ref: "#/components/schemas/RecommendationsPageMeta"
17844+
required:
17845+
- data
17846+
type: object
17847+
CostRecommendationData:
17848+
description: A single cost recommendation entry in JSON:API form.
17849+
properties:
17850+
attributes:
17851+
$ref: "#/components/schemas/CostRecommendationDataAttributes"
17852+
id:
17853+
description: Unique identifier for the recommendation.
17854+
type: string
17855+
type:
17856+
$ref: "#/components/schemas/CostRecommendationDataType"
17857+
required:
17858+
- type
17859+
type: object
17860+
CostRecommendationDataAttributes:
17861+
description: Attributes describing a single cost recommendation.
17862+
properties:
17863+
dd_resource_key:
17864+
description: Datadog resource key identifying the recommended resource.
17865+
type: string
17866+
potential_daily_savings:
17867+
$ref: "#/components/schemas/CostRecommendationDataAttributesPotentialDailySavings"
17868+
recommendation_type:
17869+
description: The kind of recommendation (for example, `terminate` or `rightsize`).
17870+
type: string
17871+
resource_id:
17872+
description: Cloud provider identifier of the resource.
17873+
type: string
17874+
resource_type:
17875+
description: Resource type (for example, `aws_ec2_instance`).
17876+
type: string
17877+
tags:
17878+
description: Tags attached to the recommended resource.
17879+
items:
17880+
description: A single resource tag.
17881+
type: string
17882+
type: array
17883+
type: object
17884+
CostRecommendationDataAttributesPotentialDailySavings:
17885+
description: Estimated daily savings if the recommendation is applied.
17886+
properties:
17887+
amount:
17888+
description: Numeric amount of the potential daily savings.
17889+
format: double
17890+
type: number
17891+
currency:
17892+
description: ISO 4217 currency code for the savings amount.
17893+
type: string
17894+
type: object
17895+
CostRecommendationDataType:
17896+
default: recommendation
17897+
description: Recommendation resource type.
17898+
enum:
17899+
- recommendation
17900+
example: recommendation
17901+
type: string
17902+
x-enum-varnames:
17903+
- RECOMMENDATION
1783417904
CostTag:
1783517905
description: A Cloud Cost Management tag.
1783617906
properties:
@@ -62894,6 +62964,64 @@ components:
6289462964
type: string
6289562965
x-enum-varnames:
6289662966
- RECOMMENDATION
62967+
RecommendationsFilterRequest:
62968+
description: Request body for filtering cost recommendations.
62969+
example:
62970+
filter: "@resource_table:aws_ec2_instance"
62971+
sort:
62972+
- expression: potential_daily_savings.amount
62973+
order: DESC
62974+
properties:
62975+
filter:
62976+
description: Filter expression applied to the recommendations.
62977+
type: string
62978+
scope:
62979+
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
62980+
type: string
62981+
sort:
62982+
description: Ordered list of sort clauses applied to the result set.
62983+
items:
62984+
$ref: "#/components/schemas/RecommendationsFilterRequestSortItems"
62985+
type: array
62986+
view:
62987+
description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`).
62988+
type: string
62989+
type: object
62990+
RecommendationsFilterRequestSortItems:
62991+
description: A single sort clause applied to the cost recommendations result set.
62992+
properties:
62993+
expression:
62994+
description: Field to sort by (for example, `potential_daily_savings.amount`).
62995+
type: string
62996+
order:
62997+
description: Sort direction, either `ASC` or `DESC`.
62998+
type: string
62999+
type: object
63000+
RecommendationsPageMeta:
63001+
description: Top-level JSON:API meta object for paginated cost recommendation responses.
63002+
properties:
63003+
page:
63004+
$ref: "#/components/schemas/RecommendationsPageMetaPage"
63005+
type: object
63006+
RecommendationsPageMetaPage:
63007+
description: Pagination metadata for a page of cost recommendations.
63008+
properties:
63009+
filter:
63010+
description: The filter expression that was applied to produce this page.
63011+
type: string
63012+
next_page_token:
63013+
description: Opaque token used to fetch the next page; absent on the last page.
63014+
type: string
63015+
page_size:
63016+
description: Number of items returned in this page (1–10000).
63017+
format: int32
63018+
maximum: 10000
63019+
minimum: 1
63020+
type: integer
63021+
page_token:
63022+
description: Pagination token echoed back from the request.
63023+
type: string
63024+
type: object
6289763025
ReferenceTableCreateSourceType:
6289863026
description: The source type for creating reference table data. Only these source types can be created through this API.
6289963027
enum:
@@ -105252,6 +105380,76 @@ paths:
105252105380
operator: OR
105253105381
permissions:
105254105382
- cloud_cost_management_read
105383+
/api/v2/cost/recommendations:
105384+
post:
105385+
description: List cost recommendations matching a filter, with pagination and sorting.
105386+
operationId: SearchCostRecommendations
105387+
parameters:
105388+
- description: Number of results per page (1–10000).
105389+
in: query
105390+
name: page[size]
105391+
schema:
105392+
type: string
105393+
- description: Pagination token from a previous response.
105394+
in: query
105395+
name: page[token]
105396+
schema:
105397+
type: string
105398+
requestBody:
105399+
content:
105400+
application/json:
105401+
examples:
105402+
default:
105403+
value:
105404+
filter: "@resource_table:aws_ec2_instance"
105405+
sort:
105406+
- expression: potential_daily_savings.amount
105407+
order: DESC
105408+
schema:
105409+
$ref: "#/components/schemas/RecommendationsFilterRequest"
105410+
required: true
105411+
responses:
105412+
"200":
105413+
content:
105414+
application/json:
105415+
examples:
105416+
default:
105417+
value:
105418+
data:
105419+
- attributes:
105420+
dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"
105421+
potential_daily_savings:
105422+
amount: 1.23
105423+
currency: USD
105424+
recommendation_type: terminate
105425+
resource_id: i-1234567890abcdef0
105426+
resource_type: aws_ec2_instance
105427+
tags:
105428+
- "env:prod"
105429+
- "team:ccm"
105430+
id: encoded-event-id-1
105431+
type: recommendation
105432+
meta:
105433+
page:
105434+
filter: "@resource_table:aws_ec2_instance"
105435+
next_page_token: ""
105436+
page_size: 100
105437+
schema:
105438+
$ref: "#/components/schemas/CostRecommendationArray"
105439+
description: OK
105440+
"429":
105441+
$ref: "#/components/responses/TooManyRequestsResponse"
105442+
security:
105443+
- apiKeyAuth: []
105444+
appKeyAuth: []
105445+
- AuthZ:
105446+
- cloud_cost_management_read
105447+
summary: Search cost recommendations
105448+
tags:
105449+
- Cloud Cost Management
105450+
x-unstable: |-
105451+
**Note**: This endpoint is in preview and is subject to change.
105452+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
105255105453
/api/v2/cost/tag_descriptions:
105256105454
get:
105257105455
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
@@ -7137,6 +7137,41 @@ datadog\_api\_client.v2.model.cost\_orchestrators\_response module
71377137
:members:
71387138
:show-inheritance:
71397139

7140+
datadog\_api\_client.v2.model.cost\_recommendation\_array module
7141+
----------------------------------------------------------------
7142+
7143+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_array
7144+
:members:
7145+
:show-inheritance:
7146+
7147+
datadog\_api\_client.v2.model.cost\_recommendation\_data module
7148+
---------------------------------------------------------------
7149+
7150+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data
7151+
:members:
7152+
:show-inheritance:
7153+
7154+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_attributes module
7155+
---------------------------------------------------------------------------
7156+
7157+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_attributes
7158+
:members:
7159+
:show-inheritance:
7160+
7161+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_attributes\_potential\_daily\_savings module
7162+
------------------------------------------------------------------------------------------------------
7163+
7164+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_attributes_potential_daily_savings
7165+
:members:
7166+
:show-inheritance:
7167+
7168+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_type module
7169+
---------------------------------------------------------------------
7170+
7171+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_type
7172+
:members:
7173+
:show-inheritance:
7174+
71407175
datadog\_api\_client.v2.model.cost\_tag module
71417176
----------------------------------------------
71427177

@@ -27122,6 +27157,34 @@ datadog\_api\_client.v2.model.recommendation\_type module
2712227157
:members:
2712327158
:show-inheritance:
2712427159

27160+
datadog\_api\_client.v2.model.recommendations\_filter\_request module
27161+
---------------------------------------------------------------------
27162+
27163+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request
27164+
:members:
27165+
:show-inheritance:
27166+
27167+
datadog\_api\_client.v2.model.recommendations\_filter\_request\_sort\_items module
27168+
----------------------------------------------------------------------------------
27169+
27170+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request_sort_items
27171+
:members:
27172+
:show-inheritance:
27173+
27174+
datadog\_api\_client.v2.model.recommendations\_page\_meta module
27175+
----------------------------------------------------------------
27176+
27177+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta
27178+
:members:
27179+
:show-inheritance:
27180+
27181+
datadog\_api\_client.v2.model.recommendations\_page\_meta\_page module
27182+
----------------------------------------------------------------------
27183+
27184+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta_page
27185+
:members:
27186+
:show-inheritance:
27187+
2712527188
datadog\_api\_client.v2.model.reference\_table\_create\_source\_type module
2712627189
---------------------------------------------------------------------------
2712727190

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""
2+
Search cost recommendations 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["search_cost_recommendations"] = True
22+
with ApiClient(configuration) as api_client:
23+
api_instance = CloudCostManagementApi(api_client)
24+
response = api_instance.search_cost_recommendations(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
@@ -407,6 +407,7 @@ def __init__(
407407
"v2.list_cost_tag_metadata": False,
408408
"v2.list_cost_tag_metadata_metrics": False,
409409
"v2.list_cost_tag_metadata_orchestrators": False,
410+
"v2.search_cost_recommendations": False,
410411
"v2.create_dashboard_secure_embed": False,
411412
"v2.delete_dashboard_secure_embed": False,
412413
"v2.get_dashboard_secure_embed": False,

0 commit comments

Comments
 (0)