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
18 changes: 13 additions & 5 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93243,7 +93243,7 @@ components:
attributes:
scope: ccm
sort:
- expression: potential_daily_savings.amount
- expression: "@potential_daily_savings"
order: DESC
id: "@resource_table:aws_ec2_instance"
type: recommendations_filter
Expand All @@ -93262,8 +93262,9 @@ components:
$ref: "#/components/schemas/RecommendationsFilterRequestDataAttributes"
id:
description: |-
Filter expression applied to the recommendations. The server treats an omitted ID as `*`
and returns all recommendations.
Filter expression applied to the recommendations when `attributes.filter` is omitted.
When supplied, `attributes.filter` overrides this value, including when empty. If the
resulting filter is empty, it defaults to `*`. Scope, view, and pagination still apply.
type: string
type:
$ref: "#/components/schemas/RecommendationsFilterRequestDataType"
Expand All @@ -93273,6 +93274,13 @@ components:
RecommendationsFilterRequestDataAttributes:
description: Attributes used to filter and sort cost recommendations.
properties:
filter:
description: |-
Filter expression applied to the recommendations. When supplied, this attribute overrides
`data.id`, including when empty. When omitted, `data.id` is used. If the resulting filter
is empty, it defaults to `*`. Scope, view, and pagination still apply.
example: "@resource_table:aws_ec2_instance"
type: string
scope:
$ref: "#/components/schemas/RecommendationsFilterRequestScope"
sort:
Expand Down Expand Up @@ -93308,7 +93316,7 @@ components:
description: A single sort clause applied to the cost recommendations result set.
properties:
expression:
description: Field to sort by (for example, `potential_daily_savings.amount`).
description: Field to sort by (for example, `@potential_daily_savings`).
type: string
order:
description: Sort direction, either `ASC` or `DESC`.
Expand Down Expand Up @@ -148137,7 +148145,7 @@ paths:
attributes:
scope: ccm
sort:
- expression: potential_daily_savings.amount
- expression: "@potential_daily_savings"
order: DESC
id: "@resource_table:aws_ec2_instance"
type: recommendations_filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const params: v2.CloudCostManagementApiSearchCostRecommendationsRequest = {
scope: "ccm",
sort: [
{
expression: "potential_daily_savings.amount",
expression: "@potential_daily_savings",
order: "DESC",
},
],
Expand Down
2 changes: 1 addition & 1 deletion features/v2/cloud_cost_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ Feature: Cloud Cost Management
Scenario: Search cost recommendations returns "OK" response
Given operation "SearchCostRecommendations" enabled
And new "SearchCostRecommendations" request
And body with value {"data": {"attributes": {"scope": "ccm", "sort": [{"expression": "potential_daily_savings.amount", "order": "DESC"}]}, "id": "@resource_table:aws_ec2_instance", "type": "recommendations_filter"}}
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 200 OK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export class RecommendationsFilterRequestData {
*/
"attributes"?: RecommendationsFilterRequestDataAttributes;
/**
* Filter expression applied to the recommendations. The server treats an omitted ID as `*`
* and returns all recommendations.
* Filter expression applied to the recommendations when `attributes.filter` is omitted.
* When supplied, `attributes.filter` overrides this value, including when empty. If the
* resulting filter is empty, it defaults to `*`. Scope, view, and pagination still apply.
*/
"id"?: string;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
* Attributes used to filter and sort cost recommendations.
*/
export class RecommendationsFilterRequestDataAttributes {
/**
* Filter expression applied to the recommendations. When supplied, this attribute overrides
* `data.id`, including when empty. When omitted, `data.id` is used. If the resulting filter
* is empty, it defaults to `*`. Scope, view, and pagination still apply.
*/
"filter"?: string;
/**
* Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both.
*/
Expand Down Expand Up @@ -41,6 +47,10 @@ export class RecommendationsFilterRequestDataAttributes {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
filter: {
baseName: "filter",
type: "string",
},
scope: {
baseName: "scope",
type: "RecommendationsFilterRequestScope",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
*/
export class RecommendationsFilterRequestSortItems {
/**
* Field to sort by (for example, `potential_daily_savings.amount`).
* Field to sort by (for example, `@potential_daily_savings`).
*/
"expression"?: string;
/**
Expand Down
Loading