Skip to content

Commit

Permalink
Regenerate client from commit 18eae8f of spec repo (#218)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jul 16, 2021
1 parent c1faf9b commit 2c8e4f1
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2021-07-15T15:24:01.025Z"
Original file line number Diff line number Diff line change
@@ -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\":\"[email protected]\",\"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"
}
}
6 changes: 6 additions & 0 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"}]}}]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class FormulaAndFunctionEventQueryDefinition {
"rum",
"security_signals",
"profiles",
"audit",
undefined,
].includes(data.data_source)
) {
Expand Down Expand Up @@ -175,6 +176,7 @@ export class FormulaAndFunctionEventQueryDefinition {
"rum",
"security_signals",
"profiles",
"audit",
undefined,
].includes(data.dataSource)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
18 changes: 18 additions & 0 deletions packages/datadog-api-client-v1/models/QueryValueWidgetRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { ObjectSerializer } from "./ObjectSerializer";
export class QueryValueWidgetRequest {
"aggregator"?: WidgetAggregator;
"apmQuery"?: LogQueryDefinition;
"auditQuery"?: LogQueryDefinition;
/**
* List of conditional formats.
*/
Expand Down Expand Up @@ -64,6 +65,11 @@ export class QueryValueWidgetRequest {
type: "LogQueryDefinition",
format: "",
},
auditQuery: {
baseName: "audit_query",
type: "LogQueryDefinition",
format: "",
},
conditionalFormats: {
baseName: "conditional_formats",
type: "Array<WidgetConditionalFormat>",
Expand Down Expand Up @@ -147,6 +153,12 @@ export class QueryValueWidgetRequest {
""
);

res.auditQuery = ObjectSerializer.deserialize(
data.audit_query,
"LogQueryDefinition",
""
);

res.conditionalFormats = ObjectSerializer.deserialize(
data.conditional_formats,
"Array<WidgetConditionalFormat>",
Expand Down Expand Up @@ -242,6 +254,12 @@ export class QueryValueWidgetRequest {
""
);

res.audit_query = ObjectSerializer.serialize(
data.auditQuery,
"LogQueryDefinition",
""
);

res.conditional_formats = ObjectSerializer.serialize(
data.conditionalFormats,
"Array<WidgetConditionalFormat>",
Expand Down
Loading

0 comments on commit 2c8e4f1

Please sign in to comment.