Skip to content

Commit 1be9e80

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 925bdeb of spec repo
1 parent 1173408 commit 1be9e80

File tree

11 files changed

+264
-1
lines changed

11 files changed

+264
-1
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7255,6 +7255,13 @@ components:
72557255
Monitor:
72567256
description: Object describing a monitor.
72577257
properties:
7258+
assets:
7259+
description: The list of monitor assets tied to a monitor which represents
7260+
key links for users to help take actions on monitor alerts (for example,
7261+
runbooks)
7262+
items:
7263+
$ref: '#/components/schemas/MonitorAsset'
7264+
type: array
72587265
created:
72597266
description: Timestamp of the monitor creation.
72607267
format: date-time
@@ -7338,6 +7345,64 @@ components:
73387345
- type
73397346
- query
73407347
type: object
7348+
MonitorAsset:
7349+
description: 'Represents key links tied to a monitor to help users take action
7350+
on alerts (Runbooks, Dashboards, Workflows)
7351+
7352+
This feature is in Preview and only available to users with the feature enabled.'
7353+
properties:
7354+
category:
7355+
$ref: '#/components/schemas/MonitorAssetCategory'
7356+
name:
7357+
description: Name for the monitor asset
7358+
example: Monitor Runbook
7359+
type: string
7360+
options:
7361+
description: Additional options that you can set on a monitor asset.
7362+
example:
7363+
hide_in_monitor_message: true
7364+
type: object
7365+
resource_key:
7366+
description: Represents the identifier of the internal datadog resource
7367+
that this asset represents. IDs in this field should be passed in as strings.
7368+
example: '12345'
7369+
type: string
7370+
resource_type:
7371+
$ref: '#/components/schemas/MonitorAssetResourceType'
7372+
template_variables:
7373+
description: Allows you to parameterize the url for the monitor asset.
7374+
example:
7375+
env: prod
7376+
region: us-east-1
7377+
type: object
7378+
url:
7379+
description: Url link for the asset
7380+
example: https://app.datadoghq.com
7381+
type: string
7382+
required:
7383+
- name
7384+
- url
7385+
- category
7386+
type: object
7387+
MonitorAssetCategory:
7388+
description: Indicates the type of asset this entity represents on a monitor
7389+
enum:
7390+
- dashboard
7391+
- workflow
7392+
- runbook
7393+
example: dashboard
7394+
type: string
7395+
x-enum-varnames:
7396+
- DASHBOARD
7397+
- WORKFLOW
7398+
- RUNBOOK
7399+
MonitorAssetResourceType:
7400+
description: Type of internal datadog resource associated with a monitor asset
7401+
enum:
7402+
- notebook
7403+
type: string
7404+
x-enum-varnames:
7405+
- NOTEBOOK
73417406
MonitorDeviceID:
73427407
description: ID of the device the Synthetics monitor is running on. Same as
73437408
`SyntheticsDeviceID`.
@@ -8452,6 +8517,14 @@ components:
84528517
MonitorUpdateRequest:
84538518
description: Object describing a monitor update request.
84548519
properties:
8520+
assets:
8521+
description: The list of monitor assets tied to a monitor, which represents
8522+
key links for users to help take actions on monitor alerts (for example,
8523+
runbooks)
8524+
items:
8525+
$ref: '#/components/schemas/MonitorAsset'
8526+
nullable: true
8527+
type: array
84558528
created:
84568529
description: Timestamp of the monitor creation.
84578530
format: date-time
@@ -31529,6 +31602,13 @@ paths:
3152931602
required: false
3153031603
schema:
3153131604
type: boolean
31605+
- description: If this argument is set to `true`, then the returned data includes
31606+
all assets tied to this monitor.
31607+
in: query
31608+
name: with_assets
31609+
required: false
31610+
schema:
31611+
type: boolean
3153231612
responses:
3153331613
'200':
3153431614
content:

features/support/scenarios_model_mapping.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
15711571
"type": "boolean",
15721572
"format": "",
15731573
},
1574+
"withAssets": {
1575+
"type": "boolean",
1576+
"format": "",
1577+
},
15741578
"operationResponseType": "Monitor",
15751579
},
15761580
"v1.UpdateMonitor": {

features/v1/monitors.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Feature: Monitors
169169
Scenario: Edit a monitor returns "Bad Request" response
170170
Given new "UpdateMonitor" request
171171
And request contains "monitor_id" parameter from "REPLACE.ME"
172-
And body with value {"draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
172+
And body with value {"assets": [{"category": "dashboard", "name": "Monitor Runbook", "options": {"hide_in_monitor_message": true}, "resource_key": "12345", "resource_type": "notebook", "template_variables": {"env": "prod", "region": "us-east-1"}, "url": "https://app.datadoghq.com"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
173173
When the request is sent
174174
Then the response status is 400 Bad Request
175175

packages/datadog-api-client-v1/apis/MonitorsApi.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
155155
monitorId: number,
156156
groupStates?: string,
157157
withDowntimes?: boolean,
158+
withAssets?: boolean,
158159
_options?: Configuration
159160
): Promise<RequestContext> {
160161
const _config = _options || this.configuration;
@@ -192,6 +193,13 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
192193
""
193194
);
194195
}
196+
if (withAssets !== undefined) {
197+
requestContext.setQueryParam(
198+
"with_assets",
199+
ObjectSerializer.serialize(withAssets, "boolean", ""),
200+
""
201+
);
202+
}
195203

196204
// Apply auth methods
197205
applySecurityAuthentication(_config, requestContext, [
@@ -1221,6 +1229,11 @@ export interface MonitorsApiGetMonitorRequest {
12211229
* @type boolean
12221230
*/
12231231
withDowntimes?: boolean;
1232+
/**
1233+
* If this argument is set to `true`, then the returned data includes all assets tied to this monitor.
1234+
* @type boolean
1235+
*/
1236+
withAssets?: boolean;
12241237
}
12251238

12261239
export interface MonitorsApiListMonitorsRequest {
@@ -1680,6 +1693,7 @@ export class MonitorsApi {
16801693
param.monitorId,
16811694
param.groupStates,
16821695
param.withDowntimes,
1696+
param.withAssets,
16831697
options
16841698
);
16851699
return requestContextPromise.then((requestContext) => {

packages/datadog-api-client-v1/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ export { MetricsQueryMetadata } from "./models/MetricsQueryMetadata";
643643
export { MetricsQueryResponse } from "./models/MetricsQueryResponse";
644644
export { MetricsQueryUnit } from "./models/MetricsQueryUnit";
645645
export { Monitor } from "./models/Monitor";
646+
export { MonitorAsset } from "./models/MonitorAsset";
647+
export { MonitorAssetCategory } from "./models/MonitorAssetCategory";
648+
export { MonitorAssetResourceType } from "./models/MonitorAssetResourceType";
646649
export { MonitorDeviceID } from "./models/MonitorDeviceID";
647650
export { MonitorDraftStatus } from "./models/MonitorDraftStatus";
648651
export { MonitorFormulaAndFunctionCostAggregator } from "./models/MonitorFormulaAndFunctionCostAggregator";

packages/datadog-api-client-v1/models/Monitor.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
import { Creator } from "./Creator";
77
import { MatchingDowntime } from "./MatchingDowntime";
8+
import { MonitorAsset } from "./MonitorAsset";
89
import { MonitorDraftStatus } from "./MonitorDraftStatus";
910
import { MonitorOptions } from "./MonitorOptions";
1011
import { MonitorOverallStates } from "./MonitorOverallStates";
@@ -17,6 +18,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1718
* Object describing a monitor.
1819
*/
1920
export class Monitor {
21+
/**
22+
* The list of monitor assets tied to a monitor which represents key links for users to help take actions on monitor alerts (for example, runbooks)
23+
*/
24+
"assets"?: Array<MonitorAsset>;
2025
/**
2126
* Timestamp of the monitor creation.
2227
*/
@@ -111,6 +116,10 @@ export class Monitor {
111116
* @ignore
112117
*/
113118
static readonly attributeTypeMap: AttributeTypeMap = {
119+
assets: {
120+
baseName: "assets",
121+
type: "Array<MonitorAsset>",
122+
},
114123
created: {
115124
baseName: "created",
116125
type: "Date",
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
import { MonitorAssetCategory } from "./MonitorAssetCategory";
7+
import { MonitorAssetResourceType } from "./MonitorAssetResourceType";
8+
9+
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
10+
11+
/**
12+
* Represents key links tied to a monitor to help users take action on alerts (Runbooks, Dashboards, Workflows)
13+
* This feature is in Preview and only available to users with the feature enabled.
14+
*/
15+
export class MonitorAsset {
16+
/**
17+
* Indicates the type of asset this entity represents on a monitor
18+
*/
19+
"category": MonitorAssetCategory;
20+
/**
21+
* Name for the monitor asset
22+
*/
23+
"name": string;
24+
/**
25+
* Additional options that you can set on a monitor asset.
26+
*/
27+
"options"?: any;
28+
/**
29+
* Represents the identifier of the internal datadog resource that this asset represents. IDs in this field should be passed in as strings.
30+
*/
31+
"resourceKey"?: string;
32+
/**
33+
* Type of internal datadog resource associated with a monitor asset
34+
*/
35+
"resourceType"?: MonitorAssetResourceType;
36+
/**
37+
* Allows you to parameterize the url for the monitor asset.
38+
*/
39+
"templateVariables"?: any;
40+
/**
41+
* Url link for the asset
42+
*/
43+
"url": string;
44+
45+
/**
46+
* A container for additional, undeclared properties.
47+
* This is a holder for any undeclared properties as specified with
48+
* the 'additionalProperties' keyword in the OAS document.
49+
*/
50+
"additionalProperties"?: { [key: string]: any };
51+
52+
/**
53+
* @ignore
54+
*/
55+
"_unparsed"?: boolean;
56+
57+
/**
58+
* @ignore
59+
*/
60+
static readonly attributeTypeMap: AttributeTypeMap = {
61+
category: {
62+
baseName: "category",
63+
type: "MonitorAssetCategory",
64+
required: true,
65+
},
66+
name: {
67+
baseName: "name",
68+
type: "string",
69+
required: true,
70+
},
71+
options: {
72+
baseName: "options",
73+
type: "any",
74+
},
75+
resourceKey: {
76+
baseName: "resource_key",
77+
type: "string",
78+
},
79+
resourceType: {
80+
baseName: "resource_type",
81+
type: "MonitorAssetResourceType",
82+
},
83+
templateVariables: {
84+
baseName: "template_variables",
85+
type: "any",
86+
},
87+
url: {
88+
baseName: "url",
89+
type: "string",
90+
required: true,
91+
},
92+
additionalProperties: {
93+
baseName: "additionalProperties",
94+
type: "{ [key: string]: any; }",
95+
},
96+
};
97+
98+
/**
99+
* @ignore
100+
*/
101+
static getAttributeTypeMap(): AttributeTypeMap {
102+
return MonitorAsset.attributeTypeMap;
103+
}
104+
105+
public constructor() {}
106+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* Indicates the type of asset this entity represents on a monitor
11+
*/
12+
13+
export type MonitorAssetCategory =
14+
| typeof DASHBOARD
15+
| typeof WORKFLOW
16+
| typeof RUNBOOK
17+
| UnparsedObject;
18+
export const DASHBOARD = "dashboard";
19+
export const WORKFLOW = "workflow";
20+
export const RUNBOOK = "runbook";
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* Type of internal datadog resource associated with a monitor asset
11+
*/
12+
13+
export type MonitorAssetResourceType = typeof NOTEBOOK | UnparsedObject;
14+
export const NOTEBOOK = "notebook";

packages/datadog-api-client-v1/models/MonitorUpdateRequest.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright 2020-Present Datadog, Inc.
55
*/
66
import { Creator } from "./Creator";
7+
import { MonitorAsset } from "./MonitorAsset";
78
import { MonitorDraftStatus } from "./MonitorDraftStatus";
89
import { MonitorOptions } from "./MonitorOptions";
910
import { MonitorOverallStates } from "./MonitorOverallStates";
@@ -16,6 +17,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1617
* Object describing a monitor update request.
1718
*/
1819
export class MonitorUpdateRequest {
20+
/**
21+
* The list of monitor assets tied to a monitor, which represents key links for users to help take actions on monitor alerts (for example, runbooks)
22+
*/
23+
"assets"?: Array<MonitorAsset>;
1924
/**
2025
* Timestamp of the monitor creation.
2126
*/
@@ -106,6 +111,10 @@ export class MonitorUpdateRequest {
106111
* @ignore
107112
*/
108113
static readonly attributeTypeMap: AttributeTypeMap = {
114+
assets: {
115+
baseName: "assets",
116+
type: "Array<MonitorAsset>",
117+
},
109118
created: {
110119
baseName: "created",
111120
type: "Date",

0 commit comments

Comments
 (0)