Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104026,7 +104026,9 @@ components:
$ref: "#/components/schemas/RecommendationsFilterRequestSortItems"
type: array
view:
description: Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`).
description: |-
Status view to return: `all`, `active` (not dismissed), `dismissed`, `open`, `in-progress`,
or `completed`. Defaults to `all`, which returns recommendations in every status.
type: string
type: object
RecommendationsFilterRequestDataType:
Expand All @@ -104039,7 +104041,9 @@ components:
x-enum-varnames:
- RECOMMENDATIONS_FILTER
RecommendationsFilterRequestScope:
description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
description: |-
Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations
or `*` for both.
enum:
- ccm
- experiment
Expand Down Expand Up @@ -104075,9 +104079,9 @@ components:
description: Opaque token used to fetch the next page; absent on the last page.
type: string
page_size:
description: Number of items returned in this page (1–10000).
description: Number of items returned in this page (1–5000).
format: int32
maximum: 10000
maximum: 5000
minimum: 1
type: integer
page_token:
Expand Down Expand Up @@ -161181,11 +161185,15 @@ paths:
description: List cost recommendations matching a filter, with pagination and sorting.
operationId: SearchCostRecommendations
parameters:
- description: Number of results per page (1–10000).
- description: Number of results per page, from 1 to 5000. Defaults to 50.
in: query
name: page[size]
schema:
type: string
default: 50
format: int32
maximum: 5000
minimum: 1
type: integer
- description: Pagination token from a previous response.
in: query
name: page[token]
Expand Down Expand Up @@ -161232,11 +161240,16 @@ paths:
meta:
page:
filter: "@resource_table:aws_ec2_instance"
next_page_token: ""
page_size: 100
schema:
$ref: "#/components/schemas/CostRecommendationArray"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
Expand All @@ -161247,6 +161260,10 @@ paths:
summary: Search cost recommendations
tags:
- Cloud Cost Management
x-permission:
operator: OR
permissions:
- cloud_cost_management_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
Expand Down
12 changes: 8 additions & 4 deletions src/datadog_api_client/v2/api/cloud_cost_management_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,11 @@ def __init__(self, api_client=None):
},
params_map={
"page_size": {
"openapi_types": (str,),
"validation": {
"inclusive_maximum": 5000,
"inclusive_minimum": 1,
},
"openapi_types": (int,),
"attribute": "page[size]",
"location": "query",
},
Expand Down Expand Up @@ -3653,16 +3657,16 @@ def search_cost_recommendations(
self,
body: RecommendationsFilterRequest,
*,
page_size: Union[str, UnsetType] = unset,
page_size: Union[int, UnsetType] = unset,
page_token: Union[str, UnsetType] = unset,
) -> CostRecommendationArray:
"""Search cost recommendations.

List cost recommendations matching a filter, with pagination and sorting.

:type body: RecommendationsFilterRequest
:param page_size: Number of results per page (1–10000).
:type page_size: str, optional
:param page_size: Number of results per page, from 1 to 5000. Defaults to 50.
:type page_size: int, optional
:param page_token: Pagination token from a previous response.
:type page_token: str, optional
:rtype: CostRecommendationArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ def __init__(
is empty, it defaults to ``*``. Scope, view, and pagination still apply.
:type filter: str, optional

:param scope: Recommendations scope. Defaults to ``ccm`` ; use ``experiment`` for experimental recommendations or ``*`` for both.
:param scope: Recommendations scope. Defaults to ``ccm`` ; use ``experiment`` for experimental recommendations
or ``*`` for both.
:type scope: RecommendationsFilterRequestScope, optional

:param sort: Ordered list of sort clauses applied to the result set.
:type sort: [RecommendationsFilterRequestSortItems], optional

:param view: Active view name (for example, ``active`` , ``dismissed`` , ``open`` , ``in-progress`` , or ``completed`` ).
:param view: Status view to return: ``all`` , ``active`` (not dismissed), ``dismissed`` , ``open`` , ``in-progress`` ,
or ``completed``. Defaults to ``all`` , which returns recommendations in every status.
:type view: str, optional
"""
if filter is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

class RecommendationsFilterRequestScope(ModelSimple):
"""
Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations
or `*` for both.

:param value: Must be one of ["ccm", "experiment", "*"].
:type value: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class RecommendationsPageMetaPage(ModelNormal):
validations = {
"page_size": {
"inclusive_maximum": 10000,
"inclusive_maximum": 5000,
"inclusive_minimum": 1,
},
}
Expand Down Expand Up @@ -54,7 +54,7 @@ def __init__(
:param next_page_token: Opaque token used to fetch the next page; absent on the last page.
:type next_page_token: str, optional

:param page_size: Number of items returned in this page (1–10000).
:param page_size: Number of items returned in this page (1–5000).
:type page_size: int, optional

:param page_token: Pagination token echoed back from the request.
Expand Down
8 changes: 8 additions & 0 deletions tests/v2/features/cloud_cost_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,14 @@ Feature: Cloud Cost Management
When the request is sent
Then the response status is 204 Successfully reordered rulesets

@generated @skip @team:ddoghq/ccm-optimize
Scenario: Search cost recommendations returns "Bad Request" response
Given operation "SearchCostRecommendations" enabled
And new "SearchCostRecommendations" request
And body with value {"data": {"attributes": {"scope": "ccm", "sort": [{"expression": "@potential_daily_savings", "order": "DESC"}]}, "id": "@resource_table:aws_ec2_instance", "type": "recommendations_filter"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:ddoghq/ccm-optimize
Scenario: Search cost recommendations returns "OK" response
Given operation "SearchCostRecommendations" enabled
Expand Down
Loading