Skip to content

Commit 290c22a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b62776e of spec repo
1 parent 1521ce9 commit 290c22a

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
@@ -17813,6 +17813,76 @@ components:
1781317813
required:
1781417814
- data
1781517815
type: object
17816+
CostRecommendationArray:
17817+
description: A page of cost recommendations with pagination metadata.
17818+
properties:
17819+
data:
17820+
description: The list of cost recommendations on this page.
17821+
items:
17822+
$ref: "#/components/schemas/CostRecommendationData"
17823+
type: array
17824+
meta:
17825+
$ref: "#/components/schemas/RecommendationsPageMeta"
17826+
required:
17827+
- data
17828+
type: object
17829+
CostRecommendationData:
17830+
description: A single cost recommendation entry in JSON:API form.
17831+
properties:
17832+
attributes:
17833+
$ref: "#/components/schemas/CostRecommendationDataAttributes"
17834+
id:
17835+
description: Unique identifier for the recommendation.
17836+
type: string
17837+
type:
17838+
$ref: "#/components/schemas/CostRecommendationDataType"
17839+
required:
17840+
- type
17841+
type: object
17842+
CostRecommendationDataAttributes:
17843+
description: Attributes describing a single cost recommendation.
17844+
properties:
17845+
dd_resource_key:
17846+
description: Datadog resource key identifying the recommended resource.
17847+
type: string
17848+
potential_daily_savings:
17849+
$ref: "#/components/schemas/CostRecommendationDataAttributesPotentialDailySavings"
17850+
recommendation_type:
17851+
description: The kind of recommendation (for example, `terminate` or `rightsize`).
17852+
type: string
17853+
resource_id:
17854+
description: Cloud provider identifier of the resource.
17855+
type: string
17856+
resource_type:
17857+
description: Resource type (for example, `aws_ec2_instance`).
17858+
type: string
17859+
tags:
17860+
description: Tags attached to the recommended resource.
17861+
items:
17862+
description: A single resource tag.
17863+
type: string
17864+
type: array
17865+
type: object
17866+
CostRecommendationDataAttributesPotentialDailySavings:
17867+
description: Estimated daily savings if the recommendation is applied.
17868+
properties:
17869+
amount:
17870+
description: Numeric amount of the potential daily savings.
17871+
format: double
17872+
type: number
17873+
currency:
17874+
description: ISO 4217 currency code for the savings amount.
17875+
type: string
17876+
type: object
17877+
CostRecommendationDataType:
17878+
default: recommendation
17879+
description: Recommendation resource type.
17880+
enum:
17881+
- recommendation
17882+
example: recommendation
17883+
type: string
17884+
x-enum-varnames:
17885+
- RECOMMENDATION
1781617886
CostTag:
1781717887
description: A Cloud Cost Management tag.
1781817888
properties:
@@ -61432,6 +61502,64 @@ components:
6143261502
type: string
6143361503
x-enum-varnames:
6143461504
- RECOMMENDATION
61505+
RecommendationsFilterRequest:
61506+
description: Request body for filtering cost recommendations.
61507+
example:
61508+
filter: "@resource_table:aws_ec2_instance"
61509+
sort:
61510+
- expression: potential_daily_savings.amount
61511+
order: DESC
61512+
properties:
61513+
filter:
61514+
description: Filter expression applied to the recommendations.
61515+
type: string
61516+
scope:
61517+
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
61518+
type: string
61519+
sort:
61520+
description: Ordered list of sort clauses applied to the result set.
61521+
items:
61522+
$ref: "#/components/schemas/RecommendationsFilterRequestSortItems"
61523+
type: array
61524+
view:
61525+
description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`).
61526+
type: string
61527+
type: object
61528+
RecommendationsFilterRequestSortItems:
61529+
description: A single sort clause applied to the cost recommendations result set.
61530+
properties:
61531+
expression:
61532+
description: Field to sort by (for example, `potential_daily_savings.amount`).
61533+
type: string
61534+
order:
61535+
description: Sort direction, either `ASC` or `DESC`.
61536+
type: string
61537+
type: object
61538+
RecommendationsPageMeta:
61539+
description: Top-level JSON:API meta object for paginated cost recommendation responses.
61540+
properties:
61541+
page:
61542+
$ref: "#/components/schemas/RecommendationsPageMetaPage"
61543+
type: object
61544+
RecommendationsPageMetaPage:
61545+
description: Pagination metadata for a page of cost recommendations.
61546+
properties:
61547+
filter:
61548+
description: The filter expression that was applied to produce this page.
61549+
type: string
61550+
next_page_token:
61551+
description: Opaque token used to fetch the next page; absent on the last page.
61552+
type: string
61553+
page_size:
61554+
description: Number of items returned in this page (1–10000).
61555+
format: int32
61556+
maximum: 10000
61557+
minimum: 1
61558+
type: integer
61559+
page_token:
61560+
description: Pagination token echoed back from the request.
61561+
type: string
61562+
type: object
6143561563
ReferenceTableCreateSourceType:
6143661564
description: The source type for creating reference table data. Only these source types can be created through this API.
6143761565
enum:
@@ -103790,6 +103918,76 @@ paths:
103790103918
operator: OR
103791103919
permissions:
103792103920
- cloud_cost_management_read
103921+
/api/v2/cost/recommendations:
103922+
post:
103923+
description: List cost recommendations matching a filter, with pagination and sorting.
103924+
operationId: SearchCostRecommendations
103925+
parameters:
103926+
- description: Number of results per page (1–10000).
103927+
in: query
103928+
name: page[size]
103929+
schema:
103930+
type: string
103931+
- description: Pagination token from a previous response.
103932+
in: query
103933+
name: page[token]
103934+
schema:
103935+
type: string
103936+
requestBody:
103937+
content:
103938+
application/json:
103939+
examples:
103940+
default:
103941+
value:
103942+
filter: "@resource_table:aws_ec2_instance"
103943+
sort:
103944+
- expression: potential_daily_savings.amount
103945+
order: DESC
103946+
schema:
103947+
$ref: "#/components/schemas/RecommendationsFilterRequest"
103948+
required: true
103949+
responses:
103950+
"200":
103951+
content:
103952+
application/json:
103953+
examples:
103954+
default:
103955+
value:
103956+
data:
103957+
- attributes:
103958+
dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"
103959+
potential_daily_savings:
103960+
amount: 1.23
103961+
currency: USD
103962+
recommendation_type: terminate
103963+
resource_id: i-1234567890abcdef0
103964+
resource_type: aws_ec2_instance
103965+
tags:
103966+
- "env:prod"
103967+
- "team:ccm"
103968+
id: encoded-event-id-1
103969+
type: recommendation
103970+
meta:
103971+
page:
103972+
filter: "@resource_table:aws_ec2_instance"
103973+
next_page_token: ""
103974+
page_size: 100
103975+
schema:
103976+
$ref: "#/components/schemas/CostRecommendationArray"
103977+
description: OK
103978+
"429":
103979+
$ref: "#/components/responses/TooManyRequestsResponse"
103980+
security:
103981+
- apiKeyAuth: []
103982+
appKeyAuth: []
103983+
- AuthZ:
103984+
- cloud_cost_management_read
103985+
summary: Search cost recommendations
103986+
tags:
103987+
- Cloud Cost Management
103988+
x-unstable: |-
103989+
**Note**: This endpoint is in preview and is subject to change.
103990+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
103793103991
/api/v2/cost/tag_descriptions:
103794103992
get:
103795103993
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

@@ -26562,6 +26597,34 @@ datadog\_api\_client.v2.model.recommendation\_type module
2656226597
:members:
2656326598
:show-inheritance:
2656426599

26600+
datadog\_api\_client.v2.model.recommendations\_filter\_request module
26601+
---------------------------------------------------------------------
26602+
26603+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request
26604+
:members:
26605+
:show-inheritance:
26606+
26607+
datadog\_api\_client.v2.model.recommendations\_filter\_request\_sort\_items module
26608+
----------------------------------------------------------------------------------
26609+
26610+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request_sort_items
26611+
:members:
26612+
:show-inheritance:
26613+
26614+
datadog\_api\_client.v2.model.recommendations\_page\_meta module
26615+
----------------------------------------------------------------
26616+
26617+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta
26618+
:members:
26619+
:show-inheritance:
26620+
26621+
datadog\_api\_client.v2.model.recommendations\_page\_meta\_page module
26622+
----------------------------------------------------------------------
26623+
26624+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta_page
26625+
:members:
26626+
:show-inheritance:
26627+
2656526628
datadog\_api\_client.v2.model.reference\_table\_create\_source\_type module
2656626629
---------------------------------------------------------------------------
2656726630

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
@@ -403,6 +403,7 @@ def __init__(
403403
"v2.list_cost_tag_metadata": False,
404404
"v2.list_cost_tag_metadata_metrics": False,
405405
"v2.list_cost_tag_metadata_orchestrators": False,
406+
"v2.search_cost_recommendations": False,
406407
"v2.create_dashboard_secure_embed": False,
407408
"v2.delete_dashboard_secure_embed": False,
408409
"v2.get_dashboard_secure_embed": False,

0 commit comments

Comments
 (0)