diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9e7ffbe910..dafd18dde6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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: @@ -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 @@ -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: @@ -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] @@ -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: @@ -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/). diff --git a/src/datadog_api_client/v2/api/cloud_cost_management_api.py b/src/datadog_api_client/v2/api/cloud_cost_management_api.py index 050291651d..efedb060bd 100644 --- a/src/datadog_api_client/v2/api/cloud_cost_management_api.py +++ b/src/datadog_api_client/v2/api/cloud_cost_management_api.py @@ -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", }, @@ -3653,7 +3657,7 @@ 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. @@ -3661,8 +3665,8 @@ def 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 diff --git a/src/datadog_api_client/v2/model/recommendations_filter_request_data_attributes.py b/src/datadog_api_client/v2/model/recommendations_filter_request_data_attributes.py index ee0c34f567..9e9a1ebeef 100644 --- a/src/datadog_api_client/v2/model/recommendations_filter_request_data_attributes.py +++ b/src/datadog_api_client/v2/model/recommendations_filter_request_data_attributes.py @@ -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: diff --git a/src/datadog_api_client/v2/model/recommendations_filter_request_scope.py b/src/datadog_api_client/v2/model/recommendations_filter_request_scope.py index bb41efb610..c0bbb71693 100644 --- a/src/datadog_api_client/v2/model/recommendations_filter_request_scope.py +++ b/src/datadog_api_client/v2/model/recommendations_filter_request_scope.py @@ -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 diff --git a/src/datadog_api_client/v2/model/recommendations_page_meta_page.py b/src/datadog_api_client/v2/model/recommendations_page_meta_page.py index ce36bbe4e1..f1388c12b8 100644 --- a/src/datadog_api_client/v2/model/recommendations_page_meta_page.py +++ b/src/datadog_api_client/v2/model/recommendations_page_meta_page.py @@ -16,7 +16,7 @@ class RecommendationsPageMetaPage(ModelNormal): validations = { "page_size": { - "inclusive_maximum": 10000, + "inclusive_maximum": 5000, "inclusive_minimum": 1, }, } @@ -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. diff --git a/tests/v2/features/cloud_cost_management.feature b/tests/v2/features/cloud_cost_management.feature index 1fe10076a2..ec0defe48d 100644 --- a/tests/v2/features/cloud_cost_management.feature +++ b/tests/v2/features/cloud_cost_management.feature @@ -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