Skip to content

Commit f4df545

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bace1ad of spec repo
1 parent 4d78432 commit f4df545

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:
@@ -63416,6 +63486,64 @@ components:
6341663486
type: string
6341763487
x-enum-varnames:
6341863488
- RECOMMENDATION
63489+
RecommendationsFilterRequest:
63490+
description: Request body for filtering cost recommendations.
63491+
example:
63492+
filter: "@resource_table:aws_ec2_instance"
63493+
sort:
63494+
- expression: potential_daily_savings.amount
63495+
order: DESC
63496+
properties:
63497+
filter:
63498+
description: Filter expression applied to the recommendations.
63499+
type: string
63500+
scope:
63501+
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
63502+
type: string
63503+
sort:
63504+
description: Ordered list of sort clauses applied to the result set.
63505+
items:
63506+
$ref: "#/components/schemas/RecommendationsFilterRequestSortItems"
63507+
type: array
63508+
view:
63509+
description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`).
63510+
type: string
63511+
type: object
63512+
RecommendationsFilterRequestSortItems:
63513+
description: A single sort clause applied to the cost recommendations result set.
63514+
properties:
63515+
expression:
63516+
description: Field to sort by (for example, `potential_daily_savings.amount`).
63517+
type: string
63518+
order:
63519+
description: Sort direction, either `ASC` or `DESC`.
63520+
type: string
63521+
type: object
63522+
RecommendationsPageMeta:
63523+
description: Top-level JSON:API meta object for paginated cost recommendation responses.
63524+
properties:
63525+
page:
63526+
$ref: "#/components/schemas/RecommendationsPageMetaPage"
63527+
type: object
63528+
RecommendationsPageMetaPage:
63529+
description: Pagination metadata for a page of cost recommendations.
63530+
properties:
63531+
filter:
63532+
description: The filter expression that was applied to produce this page.
63533+
type: string
63534+
next_page_token:
63535+
description: Opaque token used to fetch the next page; absent on the last page.
63536+
type: string
63537+
page_size:
63538+
description: Number of items returned in this page (1–10000).
63539+
format: int32
63540+
maximum: 10000
63541+
minimum: 1
63542+
type: integer
63543+
page_token:
63544+
description: Pagination token echoed back from the request.
63545+
type: string
63546+
type: object
6341963547
ReferenceTableCreateSourceType:
6342063548
description: The source type for creating reference table data. Only these source types can be created through this API.
6342163549
enum:
@@ -105830,6 +105958,76 @@ paths:
105830105958
operator: OR
105831105959
permissions:
105832105960
- cloud_cost_management_read
105961+
/api/v2/cost/recommendations:
105962+
post:
105963+
description: List cost recommendations matching a filter, with pagination and sorting.
105964+
operationId: SearchCostRecommendations
105965+
parameters:
105966+
- description: Number of results per page (1–10000).
105967+
in: query
105968+
name: page[size]
105969+
schema:
105970+
type: string
105971+
- description: Pagination token from a previous response.
105972+
in: query
105973+
name: page[token]
105974+
schema:
105975+
type: string
105976+
requestBody:
105977+
content:
105978+
application/json:
105979+
examples:
105980+
default:
105981+
value:
105982+
filter: "@resource_table:aws_ec2_instance"
105983+
sort:
105984+
- expression: potential_daily_savings.amount
105985+
order: DESC
105986+
schema:
105987+
$ref: "#/components/schemas/RecommendationsFilterRequest"
105988+
required: true
105989+
responses:
105990+
"200":
105991+
content:
105992+
application/json:
105993+
examples:
105994+
default:
105995+
value:
105996+
data:
105997+
- attributes:
105998+
dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"
105999+
potential_daily_savings:
106000+
amount: 1.23
106001+
currency: USD
106002+
recommendation_type: terminate
106003+
resource_id: i-1234567890abcdef0
106004+
resource_type: aws_ec2_instance
106005+
tags:
106006+
- "env:prod"
106007+
- "team:ccm"
106008+
id: encoded-event-id-1
106009+
type: recommendation
106010+
meta:
106011+
page:
106012+
filter: "@resource_table:aws_ec2_instance"
106013+
next_page_token: ""
106014+
page_size: 100
106015+
schema:
106016+
$ref: "#/components/schemas/CostRecommendationArray"
106017+
description: OK
106018+
"429":
106019+
$ref: "#/components/responses/TooManyRequestsResponse"
106020+
security:
106021+
- apiKeyAuth: []
106022+
appKeyAuth: []
106023+
- AuthZ:
106024+
- cloud_cost_management_read
106025+
summary: Search cost recommendations
106026+
tags:
106027+
- Cloud Cost Management
106028+
x-unstable: |-
106029+
**Note**: This endpoint is in preview and is subject to change.
106030+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
105833106031
/api/v2/cost/tag_descriptions:
105834106032
get:
105835106033
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

@@ -27318,6 +27353,34 @@ datadog\_api\_client.v2.model.recommendation\_type module
2731827353
:members:
2731927354
:show-inheritance:
2732027355

27356+
datadog\_api\_client.v2.model.recommendations\_filter\_request module
27357+
---------------------------------------------------------------------
27358+
27359+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request
27360+
:members:
27361+
:show-inheritance:
27362+
27363+
datadog\_api\_client.v2.model.recommendations\_filter\_request\_sort\_items module
27364+
----------------------------------------------------------------------------------
27365+
27366+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request_sort_items
27367+
:members:
27368+
:show-inheritance:
27369+
27370+
datadog\_api\_client.v2.model.recommendations\_page\_meta module
27371+
----------------------------------------------------------------
27372+
27373+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta
27374+
:members:
27375+
:show-inheritance:
27376+
27377+
datadog\_api\_client.v2.model.recommendations\_page\_meta\_page module
27378+
----------------------------------------------------------------------
27379+
27380+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta_page
27381+
:members:
27382+
:show-inheritance:
27383+
2732127384
datadog\_api\_client.v2.model.reference\_table\_create\_source\_type module
2732227385
---------------------------------------------------------------------------
2732327386

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
@@ -410,6 +410,7 @@ def __init__(
410410
"v2.list_cost_tag_metadata": False,
411411
"v2.list_cost_tag_metadata_metrics": False,
412412
"v2.list_cost_tag_metadata_orchestrators": False,
413+
"v2.search_cost_recommendations": False,
413414
"v2.create_dashboard_secure_embed": False,
414415
"v2.delete_dashboard_secure_embed": False,
415416
"v2.get_dashboard_secure_embed": False,

0 commit comments

Comments
 (0)