From 2c8e4f1f54c1fe90b9b5622377da1a61bc27cfe9 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 07:25:10 +0000 Subject: [PATCH] Regenerate client from commit 18eae8f of spec repo (#218) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .../frozen.json | 1 + .../recording.har | 261 ++++++++++++++++++ features/v1/dashboards.feature | 6 + .../FormulaAndFunctionEventQueryDefinition.ts | 2 + .../FormulaAndFunctionEventsDataSource.ts | 4 +- .../models/QueryValueWidgetRequest.ts | 18 ++ .../models/TimeseriesWidgetRequest.ts | 18 ++ .../models/ToplistWidgetRequest.ts | 18 ++ 9 files changed, 331 insertions(+), 5 deletions(-) create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-an-audit-logs-query_1479743011/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-an-audit-logs-query_1479743011/recording.har diff --git a/.apigentools-info b/.apigentools-info index 1d9c583b2b7..03c7d7c5579 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev11", - "regenerated": "2021-07-14 13:00:30.295886", - "spec_repo_commit": "89a8fcc" + "regenerated": "2021-07-15 15:57:15.793305", + "spec_repo_commit": "18eae8f" }, "v2": { "apigentools_version": "1.4.1.dev11", - "regenerated": "2021-07-14 13:01:44.610020", - "spec_repo_commit": "89a8fcc" + "regenerated": "2021-07-15 15:58:42.171660", + "spec_repo_commit": "18eae8f" } } } \ No newline at end of file diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-an-audit-logs-query_1479743011/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-an-audit-logs-query_1479743011/frozen.json new file mode 100644 index 00000000000..e31a5c54b4f --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-an-audit-logs-query_1479743011/frozen.json @@ -0,0 +1 @@ +"2021-07-15T15:24:01.025Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-an-audit-logs-query_1479743011/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-an-audit-logs-query_1479743011/recording.har new file mode 100644 index 00000000000..23cc40b56cb --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-an-audit-logs-query_1479743011/recording.har @@ -0,0 +1,261 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with an audit logs query", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.1.0" + }, + "entries": [ + { + "_id": "c026a8be4227432d41d0f5207407a6cb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 398, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "datadog-api-client-typescript/1.0.0-beta.4 (node 14.17.3; os Linux; arch x64)" + }, + { + "_fromType": "array", + "name": "accept", + "value": "application/json, */*;q=0.8" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "x-datadog-parent-id", + "value": "416849553464162765" + }, + { + "_fromType": "array", + "name": "x-datadog-trace-id", + "value": "6183266674255130707" + }, + { + "_fromType": "array", + "name": "content-length", + "value": "398" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.datadoghq.com" + } + ], + "headersSize": 475, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_an_audit_logs_query-1626362641 with Audit Logs Query\",\"widgets\":[{\"definition\":{\"requests\":[{\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"audit\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"\"}}],\"response_format\":\"timeseries\"}],\"type\":\"timeseries\"},\"layout\":{\"height\":2,\"width\":4,\"x\":2,\"y\":0}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 808, + "content": { + "mimeType": "application/json", + "size": 808, + "text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"p4g-d4h-n7v\",\"title\":\"Test-Create_a_new_dashboard_with_an_audit_logs_query-1626362641 with Audit Logs Query\",\"url\":\"/dashboard/p4g-d4h-n7v/test-createanewdashboardwithanauditlogsquery-1626362641-with-audit-logs-query\",\"created_at\":\"2021-07-15T15:24:01.201286+00:00\",\"modified_at\":\"2021-07-15T15:24:01.201286+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"requests\":[{\"response_format\":\"timeseries\",\"queries\":[{\"search\":{\"query\":\"\"},\"data_source\":\"audit\",\"compute\":{\"aggregation\":\"count\"},\"name\":\"query1\",\"indexes\":[\"*\"],\"group_by\":[]}]}],\"type\":\"timeseries\"},\"layout\":{\"y\":0,\"width\":4,\"x\":2,\"height\":2},\"id\":2504710761419893}],\"layout_type\":\"ordered\"}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Thu, 15 Jul 2021 15:24:01 GMT" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "content-length", + "value": "808" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "cache-control", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "strict-transport-security", + "value": "max-age=15724800;" + }, + { + "name": "content-security-policy", + "value": "frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + } + ], + "headersSize": 383, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2021-07-15T15:24:01.034Z", + "time": 202, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 202 + } + }, + { + "_id": "3707d8f0bfb5c3bc47d5b05863dd90be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "datadog-api-client-typescript/1.0.0-beta.4 (node 14.17.3; os Linux; arch x64)" + }, + { + "_fromType": "array", + "name": "accept", + "value": "application/json, */*;q=0.8" + }, + { + "_fromType": "array", + "name": "x-datadog-parent-id", + "value": "3221273726630624468" + }, + { + "_fromType": "array", + "name": "x-datadog-trace-id", + "value": "6183266674255130707" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.datadoghq.com" + } + ], + "headersSize": 437, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/p4g-d4h-n7v" + }, + "response": { + "bodySize": 38, + "content": { + "mimeType": "application/json", + "size": 38, + "text": "{\"deleted_dashboard_id\":\"p4g-d4h-n7v\"}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Thu, 15 Jul 2021 15:24:01 GMT" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "content-length", + "value": "38" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "cache-control", + "value": "no-cache" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "strict-transport-security", + "value": "max-age=15724800;" + }, + { + "name": "content-security-policy", + "value": "frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + } + ], + "headersSize": 382, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2021-07-15T15:24:01.245Z", + "time": 112, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 112 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 4e11ff71277..373fa082208 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -29,6 +29,12 @@ Feature: Dashboards When the request is sent Then the response status is 200 OK + Scenario: Create a new dashboard with an audit logs query + Given new "CreateDashboard" request + And body with value {"layout_type": "ordered", "title": "{{ unique }} with Audit Logs Query", "widgets": [{"definition": {"type": "timeseries","requests": [{"response_format": "timeseries","queries": [{"search": {"query": ""},"data_source": "audit","compute": {"aggregation": "count"},"name": "query1","indexes": ["*"],"group_by": []}]}]},"layout": {"x": 2,"y": 0,"width": 4,"height": 2}}]} + When the request is sent + Then the response status is 200 OK + Scenario: Create a new dashboard with timeseries widget containing style attributes Given new "CreateDashboard" request And body with value {"layout_type": "ordered", "title": "{{ unique }} with timeseries widget","widgets": [{"definition": {"type": "timeseries","requests": [{"q": "sum:trace.test.errors{env:prod,service:datadog-api-spec} by {resource_name}.as_count()","on_right_yaxis": false,"style": {"palette": "warm","line_type": "solid","line_width": "normal"},"display_type": "bars"}]}}]} diff --git a/packages/datadog-api-client-v1/models/FormulaAndFunctionEventQueryDefinition.ts b/packages/datadog-api-client-v1/models/FormulaAndFunctionEventQueryDefinition.ts index 6bb69b6a4b6..d68fade9255 100644 --- a/packages/datadog-api-client-v1/models/FormulaAndFunctionEventQueryDefinition.ts +++ b/packages/datadog-api-client-v1/models/FormulaAndFunctionEventQueryDefinition.ts @@ -105,6 +105,7 @@ export class FormulaAndFunctionEventQueryDefinition { "rum", "security_signals", "profiles", + "audit", undefined, ].includes(data.data_source) ) { @@ -175,6 +176,7 @@ export class FormulaAndFunctionEventQueryDefinition { "rum", "security_signals", "profiles", + "audit", undefined, ].includes(data.dataSource) ) { diff --git a/packages/datadog-api-client-v1/models/FormulaAndFunctionEventsDataSource.ts b/packages/datadog-api-client-v1/models/FormulaAndFunctionEventsDataSource.ts index 17a392f7132..ace46059fdd 100644 --- a/packages/datadog-api-client-v1/models/FormulaAndFunctionEventsDataSource.ts +++ b/packages/datadog-api-client-v1/models/FormulaAndFunctionEventsDataSource.ts @@ -14,10 +14,12 @@ export type FormulaAndFunctionEventsDataSource = | typeof NETWORK | typeof RUM | typeof SECURITY_SIGNALS - | typeof PROFILES; + | typeof PROFILES + | typeof AUDIT; export const LOGS = "logs"; export const SPANS = "spans"; export const NETWORK = "network"; export const RUM = "rum"; export const SECURITY_SIGNALS = "security_signals"; export const PROFILES = "profiles"; +export const AUDIT = "audit"; diff --git a/packages/datadog-api-client-v1/models/QueryValueWidgetRequest.ts b/packages/datadog-api-client-v1/models/QueryValueWidgetRequest.ts index 34f025f8227..b16a7b3888e 100644 --- a/packages/datadog-api-client-v1/models/QueryValueWidgetRequest.ts +++ b/packages/datadog-api-client-v1/models/QueryValueWidgetRequest.ts @@ -24,6 +24,7 @@ import { ObjectSerializer } from "./ObjectSerializer"; export class QueryValueWidgetRequest { "aggregator"?: WidgetAggregator; "apmQuery"?: LogQueryDefinition; + "auditQuery"?: LogQueryDefinition; /** * List of conditional formats. */ @@ -64,6 +65,11 @@ export class QueryValueWidgetRequest { type: "LogQueryDefinition", format: "", }, + auditQuery: { + baseName: "audit_query", + type: "LogQueryDefinition", + format: "", + }, conditionalFormats: { baseName: "conditional_formats", type: "Array", @@ -147,6 +153,12 @@ export class QueryValueWidgetRequest { "" ); + res.auditQuery = ObjectSerializer.deserialize( + data.audit_query, + "LogQueryDefinition", + "" + ); + res.conditionalFormats = ObjectSerializer.deserialize( data.conditional_formats, "Array", @@ -242,6 +254,12 @@ export class QueryValueWidgetRequest { "" ); + res.audit_query = ObjectSerializer.serialize( + data.auditQuery, + "LogQueryDefinition", + "" + ); + res.conditional_formats = ObjectSerializer.serialize( data.conditionalFormats, "Array", diff --git a/packages/datadog-api-client-v1/models/TimeseriesWidgetRequest.ts b/packages/datadog-api-client-v1/models/TimeseriesWidgetRequest.ts index 8a7e1079694..cf3f583f307 100644 --- a/packages/datadog-api-client-v1/models/TimeseriesWidgetRequest.ts +++ b/packages/datadog-api-client-v1/models/TimeseriesWidgetRequest.ts @@ -24,6 +24,7 @@ import { ObjectSerializer } from "./ObjectSerializer"; export class TimeseriesWidgetRequest { "apmQuery"?: LogQueryDefinition; + "auditQuery"?: LogQueryDefinition; "displayType"?: WidgetDisplayType; "eventQuery"?: LogQueryDefinition; /** @@ -65,6 +66,11 @@ export class TimeseriesWidgetRequest { type: "LogQueryDefinition", format: "", }, + auditQuery: { + baseName: "audit_query", + type: "LogQueryDefinition", + format: "", + }, displayType: { baseName: "display_type", type: "WidgetDisplayType", @@ -155,6 +161,12 @@ export class TimeseriesWidgetRequest { "" ); + res.auditQuery = ObjectSerializer.deserialize( + data.audit_query, + "LogQueryDefinition", + "" + ); + if (["area", "bars", "line", undefined].includes(data.display_type)) { res.displayType = data.display_type; } else { @@ -262,6 +274,12 @@ export class TimeseriesWidgetRequest { "" ); + res.audit_query = ObjectSerializer.serialize( + data.auditQuery, + "LogQueryDefinition", + "" + ); + if (["area", "bars", "line", undefined].includes(data.displayType)) { res.display_type = data.displayType; } else { diff --git a/packages/datadog-api-client-v1/models/ToplistWidgetRequest.ts b/packages/datadog-api-client-v1/models/ToplistWidgetRequest.ts index 3b26187dc84..7fd48d6f663 100644 --- a/packages/datadog-api-client-v1/models/ToplistWidgetRequest.ts +++ b/packages/datadog-api-client-v1/models/ToplistWidgetRequest.ts @@ -23,6 +23,7 @@ import { ObjectSerializer } from "./ObjectSerializer"; export class ToplistWidgetRequest { "apmQuery"?: LogQueryDefinition; + "auditQuery"?: LogQueryDefinition; /** * List of conditional formats. */ @@ -59,6 +60,11 @@ export class ToplistWidgetRequest { type: "LogQueryDefinition", format: "", }, + auditQuery: { + baseName: "audit_query", + type: "LogQueryDefinition", + format: "", + }, conditionalFormats: { baseName: "conditional_formats", type: "Array", @@ -139,6 +145,12 @@ export class ToplistWidgetRequest { "" ); + res.auditQuery = ObjectSerializer.deserialize( + data.audit_query, + "LogQueryDefinition", + "" + ); + res.conditionalFormats = ObjectSerializer.deserialize( data.conditional_formats, "Array", @@ -232,6 +244,12 @@ export class ToplistWidgetRequest { "" ); + res.audit_query = ObjectSerializer.serialize( + data.auditQuery, + "LogQueryDefinition", + "" + ); + res.conditional_formats = ObjectSerializer.serialize( data.conditionalFormats, "Array",