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
2 changes: 1 addition & 1 deletion features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3070,7 +3070,7 @@
"body" => "GCPUsageCostConfigPatchRequest",
},
"v2.SearchCostRecommendations" => {
"page_size" => "String",
"page_size" => "Integer",
"page_token" => "String",
"body" => "RecommendationsFilterRequest",
},
Expand Down
8 changes: 8 additions & 0 deletions features/v2/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
Original file line number Diff line number Diff line change
Expand Up @@ -4492,7 +4492,7 @@ def search_cost_recommendations(body, opts = {})
#
# @param body [RecommendationsFilterRequest]
# @param opts [Hash] the optional parameters
# @option opts [String] :page_size Number of results per page (1–10000).
# @option opts [Integer] :page_size Number of results per page, from 1 to 5000. Defaults to 50.
# @option opts [String] :page_token Pagination token from a previous response.
# @return [Array<(CostRecommendationArray, Integer, Hash)>] CostRecommendationArray data, response status code and response headers
def search_cost_recommendations_with_http_info(body, opts = {})
Expand All @@ -4506,6 +4506,12 @@ def search_cost_recommendations_with_http_info(body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.search_cost_recommendations ...'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 5000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CloudCostManagementAPI.search_cost_recommendations, must be smaller than or equal to 5000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CloudCostManagementAPI.search_cost_recommendations, must be greater than or equal to 1.'
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.search_cost_recommendations"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ class RecommendationsFilterRequestDataAttributes
# is empty, it defaults to `*`. Scope, view, and pagination still apply.
attr_accessor :filter

# 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.
attr_accessor :scope

# Ordered list of sort clauses applied to the result set.
attr_accessor :sort

# Active view name (for example, `active`, `dismissed`, `open`, `in-progress`, or `completed`).
# Status view to return: `all`, `active` (not dismissed), `dismissed`, `open`, `in-progress`,
# or `completed`. Defaults to `all`, which returns recommendations in every status.
attr_accessor :view

attr_accessor :additional_properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
require 'time'

module DatadogAPIClient::V2
# 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.
class RecommendationsFilterRequestScope
include BaseEnumModel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RecommendationsPageMetaPage
# Opaque token used to fetch the next page; absent on the last page.
attr_accessor :next_page_token

# Number of items returned in this page (1–10000).
# Number of items returned in this page (1–5000).
attr_reader :page_size

# Pagination token echoed back from the request.
Expand Down Expand Up @@ -96,7 +96,7 @@ def initialize(attributes = {})
# @return true if the model is valid
# @!visibility private
def valid?
return false if !@page_size.nil? && @page_size > 10000
return false if !@page_size.nil? && @page_size > 5000
return false if !@page_size.nil? && @page_size < 1
true
end
Expand All @@ -105,8 +105,8 @@ def valid?
# @param page_size [Object] Object to be assigned
# @!visibility private
def page_size=(page_size)
if !page_size.nil? && page_size > 10000
fail ArgumentError, 'invalid value for "page_size", must be smaller than or equal to 10000.'
if !page_size.nil? && page_size > 5000
fail ArgumentError, 'invalid value for "page_size", must be smaller than or equal to 5000.'
end
if !page_size.nil? && page_size < 1
fail ArgumentError, 'invalid value for "page_size", must be greater than or equal to 1.'
Expand Down
Loading