Skip to content

Commit 16ddecf

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bb901c3 of spec repo
1 parent 330bd16 commit 16ddecf

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
@@ -16777,6 +16777,76 @@ components:
1677716777
required:
1677816778
- data
1677916779
type: object
16780+
CostRecommendationArray:
16781+
description: A page of cost recommendations with pagination metadata.
16782+
properties:
16783+
data:
16784+
description: The list of cost recommendations on this page.
16785+
items:
16786+
$ref: "#/components/schemas/CostRecommendationData"
16787+
type: array
16788+
meta:
16789+
$ref: "#/components/schemas/RecommendationsPageMeta"
16790+
required:
16791+
- data
16792+
type: object
16793+
CostRecommendationData:
16794+
description: A single cost recommendation entry in JSON:API form.
16795+
properties:
16796+
attributes:
16797+
$ref: "#/components/schemas/CostRecommendationDataAttributes"
16798+
id:
16799+
description: Unique identifier for the recommendation.
16800+
type: string
16801+
type:
16802+
$ref: "#/components/schemas/CostRecommendationDataType"
16803+
required:
16804+
- type
16805+
type: object
16806+
CostRecommendationDataAttributes:
16807+
description: Attributes describing a single cost recommendation.
16808+
properties:
16809+
dd_resource_key:
16810+
description: Datadog resource key identifying the recommended resource.
16811+
type: string
16812+
potential_daily_savings:
16813+
$ref: "#/components/schemas/CostRecommendationDataAttributesPotentialDailySavings"
16814+
recommendation_type:
16815+
description: The kind of recommendation (for example, `terminate` or `rightsize`).
16816+
type: string
16817+
resource_id:
16818+
description: Cloud provider identifier of the resource.
16819+
type: string
16820+
resource_type:
16821+
description: Resource type (for example, `aws_ec2_instance`).
16822+
type: string
16823+
tags:
16824+
description: Tags attached to the recommended resource.
16825+
items:
16826+
description: A single resource tag.
16827+
type: string
16828+
type: array
16829+
type: object
16830+
CostRecommendationDataAttributesPotentialDailySavings:
16831+
description: Estimated daily savings if the recommendation is applied.
16832+
properties:
16833+
amount:
16834+
description: Numeric amount of the potential daily savings.
16835+
format: double
16836+
type: number
16837+
currency:
16838+
description: ISO 4217 currency code for the savings amount.
16839+
type: string
16840+
type: object
16841+
CostRecommendationDataType:
16842+
default: recommendation
16843+
description: Recommendation resource type.
16844+
enum:
16845+
- recommendation
16846+
example: recommendation
16847+
type: string
16848+
x-enum-varnames:
16849+
- RECOMMENDATION
1678016850
CostTag:
1678116851
description: A Cloud Cost Management tag.
1678216852
properties:
@@ -59937,6 +60007,64 @@ components:
5993760007
type: string
5993860008
x-enum-varnames:
5993960009
- RECOMMENDATION
60010+
RecommendationsFilterRequest:
60011+
description: Request body for filtering cost recommendations.
60012+
example:
60013+
filter: "@resource_table:aws_ec2_instance"
60014+
sort:
60015+
- expression: potential_daily_savings.amount
60016+
order: DESC
60017+
properties:
60018+
filter:
60019+
description: Filter expression applied to the recommendations.
60020+
type: string
60021+
scope:
60022+
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
60023+
type: string
60024+
sort:
60025+
description: Ordered list of sort clauses applied to the result set.
60026+
items:
60027+
$ref: "#/components/schemas/RecommendationsFilterRequestSortItems"
60028+
type: array
60029+
view:
60030+
description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`).
60031+
type: string
60032+
type: object
60033+
RecommendationsFilterRequestSortItems:
60034+
description: A single sort clause applied to the cost recommendations result set.
60035+
properties:
60036+
expression:
60037+
description: Field to sort by (for example, `potential_daily_savings.amount`).
60038+
type: string
60039+
order:
60040+
description: Sort direction, either `ASC` or `DESC`.
60041+
type: string
60042+
type: object
60043+
RecommendationsPageMeta:
60044+
description: Top-level JSON:API meta object for paginated cost recommendation responses.
60045+
properties:
60046+
page:
60047+
$ref: "#/components/schemas/RecommendationsPageMetaPage"
60048+
type: object
60049+
RecommendationsPageMetaPage:
60050+
description: Pagination metadata for a page of cost recommendations.
60051+
properties:
60052+
filter:
60053+
description: The filter expression that was applied to produce this page.
60054+
type: string
60055+
next_page_token:
60056+
description: Opaque token used to fetch the next page; absent on the last page.
60057+
type: string
60058+
page_size:
60059+
description: Number of items returned in this page (1–10000).
60060+
format: int32
60061+
maximum: 10000
60062+
minimum: 1
60063+
type: integer
60064+
page_token:
60065+
description: Pagination token echoed back from the request.
60066+
type: string
60067+
type: object
5994060068
ReferenceTableCreateSourceType:
5994160069
description: The source type for creating reference table data. Only these source types can be created through this API.
5994260070
enum:
@@ -100464,6 +100592,76 @@ paths:
100464100592
operator: OR
100465100593
permissions:
100466100594
- cloud_cost_management_read
100595+
/api/v2/cost/recommendations:
100596+
post:
100597+
description: List cost recommendations matching a filter, with pagination and sorting.
100598+
operationId: SearchCostRecommendations
100599+
parameters:
100600+
- description: Number of results per page (1–10000).
100601+
in: query
100602+
name: page[size]
100603+
schema:
100604+
type: string
100605+
- description: Pagination token from a previous response.
100606+
in: query
100607+
name: page[token]
100608+
schema:
100609+
type: string
100610+
requestBody:
100611+
content:
100612+
application/json:
100613+
examples:
100614+
default:
100615+
value:
100616+
filter: "@resource_table:aws_ec2_instance"
100617+
sort:
100618+
- expression: potential_daily_savings.amount
100619+
order: DESC
100620+
schema:
100621+
$ref: "#/components/schemas/RecommendationsFilterRequest"
100622+
required: true
100623+
responses:
100624+
"200":
100625+
content:
100626+
application/json:
100627+
examples:
100628+
default:
100629+
value:
100630+
data:
100631+
- attributes:
100632+
dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"
100633+
potential_daily_savings:
100634+
amount: 1.23
100635+
currency: USD
100636+
recommendation_type: terminate
100637+
resource_id: i-1234567890abcdef0
100638+
resource_type: aws_ec2_instance
100639+
tags:
100640+
- "env:prod"
100641+
- "team:ccm"
100642+
id: encoded-event-id-1
100643+
type: recommendation
100644+
meta:
100645+
page:
100646+
filter: "@resource_table:aws_ec2_instance"
100647+
next_page_token: ""
100648+
page_size: 100
100649+
schema:
100650+
$ref: "#/components/schemas/CostRecommendationArray"
100651+
description: OK
100652+
"429":
100653+
$ref: "#/components/responses/TooManyRequestsResponse"
100654+
security:
100655+
- apiKeyAuth: []
100656+
appKeyAuth: []
100657+
- AuthZ:
100658+
- cloud_cost_management_read
100659+
summary: Search cost recommendations
100660+
tags:
100661+
- Cloud Cost Management
100662+
x-unstable: |-
100663+
**Note**: This endpoint is in preview and is subject to change.
100664+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
100467100665
/api/v2/cost/tag_descriptions:
100468100666
get:
100469100667
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
@@ -6598,6 +6598,41 @@ datadog\_api\_client.v2.model.cost\_orchestrators\_response module
65986598
:members:
65996599
:show-inheritance:
66006600

6601+
datadog\_api\_client.v2.model.cost\_recommendation\_array module
6602+
----------------------------------------------------------------
6603+
6604+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_array
6605+
:members:
6606+
:show-inheritance:
6607+
6608+
datadog\_api\_client.v2.model.cost\_recommendation\_data module
6609+
---------------------------------------------------------------
6610+
6611+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data
6612+
:members:
6613+
:show-inheritance:
6614+
6615+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_attributes module
6616+
---------------------------------------------------------------------------
6617+
6618+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_attributes
6619+
:members:
6620+
:show-inheritance:
6621+
6622+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_attributes\_potential\_daily\_savings module
6623+
------------------------------------------------------------------------------------------------------
6624+
6625+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_attributes_potential_daily_savings
6626+
:members:
6627+
:show-inheritance:
6628+
6629+
datadog\_api\_client.v2.model.cost\_recommendation\_data\_type module
6630+
---------------------------------------------------------------------
6631+
6632+
.. automodule:: datadog_api_client.v2.model.cost_recommendation_data_type
6633+
:members:
6634+
:show-inheritance:
6635+
66016636
datadog\_api\_client.v2.model.cost\_tag module
66026637
----------------------------------------------
66036638

@@ -25820,6 +25855,34 @@ datadog\_api\_client.v2.model.recommendation\_type module
2582025855
:members:
2582125856
:show-inheritance:
2582225857

25858+
datadog\_api\_client.v2.model.recommendations\_filter\_request module
25859+
---------------------------------------------------------------------
25860+
25861+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request
25862+
:members:
25863+
:show-inheritance:
25864+
25865+
datadog\_api\_client.v2.model.recommendations\_filter\_request\_sort\_items module
25866+
----------------------------------------------------------------------------------
25867+
25868+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request_sort_items
25869+
:members:
25870+
:show-inheritance:
25871+
25872+
datadog\_api\_client.v2.model.recommendations\_page\_meta module
25873+
----------------------------------------------------------------
25874+
25875+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta
25876+
:members:
25877+
:show-inheritance:
25878+
25879+
datadog\_api\_client.v2.model.recommendations\_page\_meta\_page module
25880+
----------------------------------------------------------------------
25881+
25882+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta_page
25883+
:members:
25884+
:show-inheritance:
25885+
2582325886
datadog\_api\_client.v2.model.reference\_table\_create\_source\_type module
2582425887
---------------------------------------------------------------------------
2582525888

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
@@ -367,6 +367,7 @@ def __init__(
367367
"v2.list_cost_tag_metadata": False,
368368
"v2.list_cost_tag_metadata_metrics": False,
369369
"v2.list_cost_tag_metadata_orchestrators": False,
370+
"v2.search_cost_recommendations": False,
370371
"v2.create_dashboard_secure_embed": False,
371372
"v2.delete_dashboard_secure_embed": False,
372373
"v2.get_dashboard_secure_embed": False,

0 commit comments

Comments
 (0)