Skip to content

Commit 74924f7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 25f4ac3 of spec repo
1 parent d304035 commit 74924f7

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:
@@ -63436,6 +63506,64 @@ components:
6343663506
type: string
6343763507
x-enum-varnames:
6343863508
- RECOMMENDATION
63509+
RecommendationsFilterRequest:
63510+
description: Request body for filtering cost recommendations.
63511+
example:
63512+
filter: "@resource_table:aws_ec2_instance"
63513+
sort:
63514+
- expression: potential_daily_savings.amount
63515+
order: DESC
63516+
properties:
63517+
filter:
63518+
description: Filter expression applied to the recommendations.
63519+
type: string
63520+
scope:
63521+
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
63522+
type: string
63523+
sort:
63524+
description: Ordered list of sort clauses applied to the result set.
63525+
items:
63526+
$ref: "#/components/schemas/RecommendationsFilterRequestSortItems"
63527+
type: array
63528+
view:
63529+
description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`).
63530+
type: string
63531+
type: object
63532+
RecommendationsFilterRequestSortItems:
63533+
description: A single sort clause applied to the cost recommendations result set.
63534+
properties:
63535+
expression:
63536+
description: Field to sort by (for example, `potential_daily_savings.amount`).
63537+
type: string
63538+
order:
63539+
description: Sort direction, either `ASC` or `DESC`.
63540+
type: string
63541+
type: object
63542+
RecommendationsPageMeta:
63543+
description: Top-level JSON:API meta object for paginated cost recommendation responses.
63544+
properties:
63545+
page:
63546+
$ref: "#/components/schemas/RecommendationsPageMetaPage"
63547+
type: object
63548+
RecommendationsPageMetaPage:
63549+
description: Pagination metadata for a page of cost recommendations.
63550+
properties:
63551+
filter:
63552+
description: The filter expression that was applied to produce this page.
63553+
type: string
63554+
next_page_token:
63555+
description: Opaque token used to fetch the next page; absent on the last page.
63556+
type: string
63557+
page_size:
63558+
description: Number of items returned in this page (1–10000).
63559+
format: int32
63560+
maximum: 10000
63561+
minimum: 1
63562+
type: integer
63563+
page_token:
63564+
description: Pagination token echoed back from the request.
63565+
type: string
63566+
type: object
6343963567
ReferenceTableCreateSourceType:
6344063568
description: The source type for creating reference table data. Only these source types can be created through this API.
6344163569
enum:
@@ -105850,6 +105978,76 @@ paths:
105850105978
operator: OR
105851105979
permissions:
105852105980
- cloud_cost_management_read
105981+
/api/v2/cost/recommendations:
105982+
post:
105983+
description: List cost recommendations matching a filter, with pagination and sorting.
105984+
operationId: SearchCostRecommendations
105985+
parameters:
105986+
- description: Number of results per page (1–10000).
105987+
in: query
105988+
name: page[size]
105989+
schema:
105990+
type: string
105991+
- description: Pagination token from a previous response.
105992+
in: query
105993+
name: page[token]
105994+
schema:
105995+
type: string
105996+
requestBody:
105997+
content:
105998+
application/json:
105999+
examples:
106000+
default:
106001+
value:
106002+
filter: "@resource_table:aws_ec2_instance"
106003+
sort:
106004+
- expression: potential_daily_savings.amount
106005+
order: DESC
106006+
schema:
106007+
$ref: "#/components/schemas/RecommendationsFilterRequest"
106008+
required: true
106009+
responses:
106010+
"200":
106011+
content:
106012+
application/json:
106013+
examples:
106014+
default:
106015+
value:
106016+
data:
106017+
- attributes:
106018+
dd_resource_key: "arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0"
106019+
potential_daily_savings:
106020+
amount: 1.23
106021+
currency: USD
106022+
recommendation_type: terminate
106023+
resource_id: i-1234567890abcdef0
106024+
resource_type: aws_ec2_instance
106025+
tags:
106026+
- "env:prod"
106027+
- "team:ccm"
106028+
id: encoded-event-id-1
106029+
type: recommendation
106030+
meta:
106031+
page:
106032+
filter: "@resource_table:aws_ec2_instance"
106033+
next_page_token: ""
106034+
page_size: 100
106035+
schema:
106036+
$ref: "#/components/schemas/CostRecommendationArray"
106037+
description: OK
106038+
"429":
106039+
$ref: "#/components/responses/TooManyRequestsResponse"
106040+
security:
106041+
- apiKeyAuth: []
106042+
appKeyAuth: []
106043+
- AuthZ:
106044+
- cloud_cost_management_read
106045+
summary: Search cost recommendations
106046+
tags:
106047+
- Cloud Cost Management
106048+
x-unstable: |-
106049+
**Note**: This endpoint is in preview and is subject to change.
106050+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
105853106051
/api/v2/cost/tag_descriptions:
105854106052
get:
105855106053
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

@@ -27332,6 +27367,34 @@ datadog\_api\_client.v2.model.recommendation\_type module
2733227367
:members:
2733327368
:show-inheritance:
2733427369

27370+
datadog\_api\_client.v2.model.recommendations\_filter\_request module
27371+
---------------------------------------------------------------------
27372+
27373+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request
27374+
:members:
27375+
:show-inheritance:
27376+
27377+
datadog\_api\_client.v2.model.recommendations\_filter\_request\_sort\_items module
27378+
----------------------------------------------------------------------------------
27379+
27380+
.. automodule:: datadog_api_client.v2.model.recommendations_filter_request_sort_items
27381+
:members:
27382+
:show-inheritance:
27383+
27384+
datadog\_api\_client.v2.model.recommendations\_page\_meta module
27385+
----------------------------------------------------------------
27386+
27387+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta
27388+
:members:
27389+
:show-inheritance:
27390+
27391+
datadog\_api\_client.v2.model.recommendations\_page\_meta\_page module
27392+
----------------------------------------------------------------------
27393+
27394+
.. automodule:: datadog_api_client.v2.model.recommendations_page_meta_page
27395+
:members:
27396+
:show-inheritance:
27397+
2733527398
datadog\_api\_client.v2.model.reference\_table\_create\_source\_type module
2733627399
---------------------------------------------------------------------------
2733727400

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)