-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 824086bb of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Jul 11, 2023
1 parent
dfb657f
commit e104c11
Showing
11 changed files
with
313 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...with-a-timeseries-widget-using-formulas-and-functions-cloud-cost-q_3324864416/frozen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"2023-07-11T14:32:45.409Z" |
110 changes: 110 additions & 0 deletions
110
...th-a-timeseries-widget-using-formulas-and-functions-cloud-cost-q_3324864416/recording.har
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"log": { | ||
"_recordingName": "Dashboards/Create a new dashboard with a timeseries widget using formulas and functions cloud cost query", | ||
"creator": { | ||
"comment": "persister:fs", | ||
"name": "Polly.JS", | ||
"version": "6.0.5" | ||
}, | ||
"entries": [ | ||
{ | ||
"_id": "21554e3cbbf51a3f13fd398b7622a007", | ||
"_order": 0, | ||
"cache": {}, | ||
"request": { | ||
"bodySize": 577, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"_fromType": "array", | ||
"name": "accept", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "content-type", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 558, | ||
"httpVersion": "HTTP/1.1", | ||
"method": "POST", | ||
"postData": { | ||
"mimeType": "application/json", | ||
"params": [], | ||
"text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_a_timeseries_widget_using_formulas_and_functions_cloud_cost_query-1689085965\",\"widgets\":[{\"definition\":{\"requests\":[{\"display_type\":\"bars\",\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"cloud_cost\",\"name\":\"query1\",\"query\":\"sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)\"}],\"response_format\":\"timeseries\",\"style\":{\"line_type\":\"solid\",\"line_width\":\"normal\",\"palette\":\"dog_classic\"}}],\"title\":\"Example Cloud Cost Query\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"timeseries\"}}]}" | ||
}, | ||
"queryString": [], | ||
"url": "https://api.datadoghq.com/api/v1/dashboard" | ||
}, | ||
"response": { | ||
"bodySize": 988, | ||
"content": { | ||
"mimeType": "application/json", | ||
"size": 988, | ||
"text": "{\"id\":\"kka-2iz-3jf\",\"title\":\"Test-Create_a_new_dashboard_with_a_timeseries_widget_using_formulas_and_functions_cloud_cost_query-1689085965\",\"description\":null,\"author_handle\":\"[email protected]\",\"author_name\":null,\"layout_type\":\"ordered\",\"url\":\"/dashboard/kka-2iz-3jf/test-createanewdashboardwithatimeserieswidgetusingformulasandfunctionscloudcostq\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"display_type\":\"bars\",\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"cloud_cost\",\"name\":\"query1\",\"query\":\"sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)\"}],\"response_format\":\"timeseries\",\"style\":{\"line_type\":\"solid\",\"line_width\":\"normal\",\"palette\":\"dog_classic\"}}],\"title\":\"Example Cloud Cost Query\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"timeseries\"},\"id\":1004255439340}],\"notify_list\":null,\"created_at\":\"2023-07-11T14:32:45.564617+00:00\",\"modified_at\":\"2023-07-11T14:32:45.564617+00:00\",\"restricted_roles\":[]}\n" | ||
}, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"name": "content-type", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 517, | ||
"httpVersion": "HTTP/1.1", | ||
"redirectURL": "", | ||
"status": 200, | ||
"statusText": "OK" | ||
}, | ||
"startedDateTime": "2023-07-11T14:32:45.418Z", | ||
"time": 219 | ||
}, | ||
{ | ||
"_id": "7c80e62c382149b2a53afcb41ec2fea8", | ||
"_order": 0, | ||
"cache": {}, | ||
"request": { | ||
"bodySize": 0, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"_fromType": "array", | ||
"name": "accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 519, | ||
"httpVersion": "HTTP/1.1", | ||
"method": "DELETE", | ||
"queryString": [], | ||
"url": "https://api.datadoghq.com/api/v1/dashboard/kka-2iz-3jf" | ||
}, | ||
"response": { | ||
"bodySize": 39, | ||
"content": { | ||
"mimeType": "application/json", | ||
"size": 39, | ||
"text": "{\"deleted_dashboard_id\":\"kka-2iz-3jf\"}\n" | ||
}, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"name": "content-type", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 516, | ||
"httpVersion": "HTTP/1.1", | ||
"redirectURL": "", | ||
"status": 200, | ||
"statusText": "OK" | ||
}, | ||
"startedDateTime": "2023-07-11T14:32:45.648Z", | ||
"time": 186 | ||
} | ||
], | ||
"pages": [], | ||
"version": "1.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Create a new dashboard with a timeseries widget using formulas and functions cloud cost query | ||
*/ | ||
|
||
import { client, v1 } from "@datadog/datadog-api-client"; | ||
|
||
const configuration = client.createConfiguration(); | ||
const apiInstance = new v1.DashboardsApi(configuration); | ||
|
||
const params: v1.DashboardsApiCreateDashboardRequest = { | ||
body: { | ||
title: "Example-Dashboard", | ||
widgets: [ | ||
{ | ||
definition: { | ||
title: "Example Cloud Cost Query", | ||
titleSize: "16", | ||
titleAlign: "left", | ||
type: "timeseries", | ||
requests: [ | ||
{ | ||
formulas: [ | ||
{ | ||
formula: "query1", | ||
}, | ||
], | ||
queries: [ | ||
{ | ||
dataSource: "cloud_cost", | ||
name: "query1", | ||
query: | ||
"sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)", | ||
}, | ||
], | ||
responseFormat: "timeseries", | ||
style: { | ||
palette: "dog_classic", | ||
lineType: "solid", | ||
lineWidth: "normal", | ||
}, | ||
displayType: "bars", | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
layoutType: "ordered", | ||
}, | ||
}; | ||
|
||
apiInstance | ||
.createDashboard(params) | ||
.then((data: v1.Dashboard) => { | ||
console.log( | ||
"API called successfully. Returned data: " + JSON.stringify(data) | ||
); | ||
}) | ||
.catch((error: any) => console.error(error)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/datadog-api-client-v1/models/FormulaAndFunctionCloudCostDataSource.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2020-Present Datadog, Inc. | ||
*/ | ||
|
||
import { UnparsedObject } from "../../datadog-api-client-common/util"; | ||
|
||
/** | ||
* Data source for Cloud Cost queries. | ||
*/ | ||
|
||
export type FormulaAndFunctionCloudCostDataSource = | ||
| typeof CLOUD_COST | ||
| UnparsedObject; | ||
export const CLOUD_COST = "cloud_cost"; |
70 changes: 70 additions & 0 deletions
70
packages/datadog-api-client-v1/models/FormulaAndFunctionCloudCostQueryDefinition.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2020-Present Datadog, Inc. | ||
*/ | ||
import { FormulaAndFunctionCloudCostDataSource } from "./FormulaAndFunctionCloudCostDataSource"; | ||
import { WidgetAggregator } from "./WidgetAggregator"; | ||
|
||
import { AttributeTypeMap } from "../../datadog-api-client-common/util"; | ||
|
||
/** | ||
* A formula and functions Cloud Cost query. | ||
*/ | ||
export class FormulaAndFunctionCloudCostQueryDefinition { | ||
/** | ||
* Aggregator used for the request. | ||
*/ | ||
"aggregator"?: WidgetAggregator; | ||
/** | ||
* Data source for Cloud Cost queries. | ||
*/ | ||
"dataSource": FormulaAndFunctionCloudCostDataSource; | ||
/** | ||
* Name of the query for use in formulas. | ||
*/ | ||
"name": string; | ||
/** | ||
* Query for Cloud Cost data. | ||
*/ | ||
"query": string; | ||
|
||
/** | ||
* @ignore | ||
*/ | ||
"_unparsed"?: boolean; | ||
|
||
/** | ||
* @ignore | ||
*/ | ||
static readonly attributeTypeMap: AttributeTypeMap = { | ||
aggregator: { | ||
baseName: "aggregator", | ||
type: "WidgetAggregator", | ||
}, | ||
dataSource: { | ||
baseName: "data_source", | ||
type: "FormulaAndFunctionCloudCostDataSource", | ||
required: true, | ||
}, | ||
name: { | ||
baseName: "name", | ||
type: "string", | ||
required: true, | ||
}, | ||
query: { | ||
baseName: "query", | ||
type: "string", | ||
required: true, | ||
}, | ||
}; | ||
|
||
/** | ||
* @ignore | ||
*/ | ||
static getAttributeTypeMap(): AttributeTypeMap { | ||
return FormulaAndFunctionCloudCostQueryDefinition.attributeTypeMap; | ||
} | ||
|
||
public constructor() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.