Skip to content

Commit e2e6a9f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Monitor Notif rule GA (#2445)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent aa27003 commit e2e6a9f

File tree

4 files changed

+10
-89
lines changed

4 files changed

+10
-89
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54853,9 +54853,6 @@ paths:
5485354853
- monitors_read
5485454854
x-undo:
5485554855
type: safe
54856-
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
54857-
54858-
contact [Datadog support](https://docs.datadoghq.com/help/).'
5485954856
post:
5486054857
description: Creates a monitor notification rule.
5486154858
operationId: CreateMonitorNotificationRule
@@ -54916,9 +54913,6 @@ paths:
5491654913
- name: rule_id
5491754914
source: data.id
5491854915
type: unsafe
54919-
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
54920-
54921-
contact [Datadog support](https://docs.datadoghq.com/help/).'
5492254916
/api/v2/monitor/notification_rule/{rule_id}:
5492354917
delete:
5492454918
description: Deletes a monitor notification rule by `rule_id`.
@@ -54962,9 +54956,6 @@ paths:
5496254956
- monitor_config_policy_write
5496354957
x-undo:
5496454958
type: idempotent
54965-
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
54966-
54967-
contact [Datadog support](https://docs.datadoghq.com/help/).'
5496854959
get:
5496954960
description: Returns a monitor notification rule by `rule_id`.
5497054961
operationId: GetMonitorNotificationRule
@@ -55021,9 +55012,6 @@ paths:
5502155012
- monitors_read
5502255013
x-undo:
5502355014
type: safe
55024-
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
55025-
55026-
contact [Datadog support](https://docs.datadoghq.com/help/).'
5502755015
patch:
5502855016
description: Updates a monitor notification rule by `rule_id`.
5502955017
operationId: UpdateMonitorNotificationRule
@@ -55084,9 +55072,6 @@ paths:
5508455072
- monitor_config_policy_write
5508555073
x-undo:
5508655074
type: idempotent
55087-
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
55088-
55089-
contact [Datadog support](https://docs.datadoghq.com/help/).'
5509055075
/api/v2/monitor/policy:
5509155076
get:
5509255077
description: Get all monitor configuration policies.

features/v2/monitors.feature

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ Feature: Monitors
3131

3232
@skip-validation @team:DataDog/monitor-app
3333
Scenario: Create a monitor notification rule returns "Bad Request" response
34-
Given operation "CreateMonitorNotificationRule" enabled
35-
And new "CreateMonitorNotificationRule" request
34+
Given new "CreateMonitorNotificationRule" request
3635
And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}", "host:abc"]}, "name": "test rule", "recipients": ["@slack-test-channel", "@jira-test"]}, "type": "monitor-notification-rule"}}
3736
When the request is sent
3837
Then the response status is 400 Bad Request
3938

4039
@team:DataDog/monitor-app
4140
Scenario: Create a monitor notification rule returns "OK" response
42-
Given operation "CreateMonitorNotificationRule" enabled
43-
And new "CreateMonitorNotificationRule" request
41+
Given new "CreateMonitorNotificationRule" request
4442
And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}"]}, "name": "test rule", "recipients": ["slack-test-channel", "jira-test"]}, "type": "monitor-notification-rule"}}
4543
When the request is sent
4644
Then the response status is 200 OK
@@ -86,16 +84,14 @@ Feature: Monitors
8684

8785
@team:DataDog/monitor-app
8886
Scenario: Delete a monitor notification rule returns "Not Found" response
89-
Given operation "DeleteMonitorNotificationRule" enabled
90-
And new "DeleteMonitorNotificationRule" request
87+
Given new "DeleteMonitorNotificationRule" request
9188
And request contains "rule_id" parameter with value "00000000-0000-1234-0000-000000000000"
9289
When the request is sent
9390
Then the response status is 404 Not Found
9491

9592
@team:DataDog/monitor-app
9693
Scenario: Delete a monitor notification rule returns "OK" response
97-
Given operation "DeleteMonitorNotificationRule" enabled
98-
And there is a valid "monitor_notification_rule" in the system
94+
Given there is a valid "monitor_notification_rule" in the system
9995
And new "DeleteMonitorNotificationRule" request
10096
And request contains "rule_id" parameter from "monitor_notification_rule.data.id"
10197
When the request is sent
@@ -170,16 +166,14 @@ Feature: Monitors
170166

171167
@team:DataDog/monitor-app
172168
Scenario: Get a monitor notification rule returns "Not Found" response
173-
Given operation "GetMonitorNotificationRule" enabled
174-
And new "GetMonitorNotificationRule" request
169+
Given new "GetMonitorNotificationRule" request
175170
And request contains "rule_id" parameter with value "00000000-0000-1234-0000-000000000000"
176171
When the request is sent
177172
Then the response status is 404 Not Found
178173

179174
@team:DataDog/monitor-app
180175
Scenario: Get a monitor notification rule returns "OK" response
181-
Given operation "GetMonitorNotificationRule" enabled
182-
And there is a valid "monitor_notification_rule" in the system
176+
Given there is a valid "monitor_notification_rule" in the system
183177
And new "GetMonitorNotificationRule" request
184178
And request contains "rule_id" parameter from "monitor_notification_rule.data.id"
185179
When the request is sent
@@ -218,8 +212,7 @@ Feature: Monitors
218212

219213
@team:DataDog/monitor-app
220214
Scenario: Get all monitor notification rules returns "OK" response
221-
Given operation "GetMonitorNotificationRules" enabled
222-
And there is a valid "monitor_notification_rule" in the system
215+
Given there is a valid "monitor_notification_rule" in the system
223216
And new "GetMonitorNotificationRules" request
224217
When the request is sent
225218
Then the response status is 200 OK
@@ -237,8 +230,7 @@ Feature: Monitors
237230

238231
@skip-validation @team:DataDog/monitor-app
239232
Scenario: Update a monitor notification rule returns "Bad Request" response
240-
Given operation "UpdateMonitorNotificationRule" enabled
241-
And there is a valid "monitor_notification_rule" in the system
233+
Given there is a valid "monitor_notification_rule" in the system
242234
And new "UpdateMonitorNotificationRule" request
243235
And request contains "rule_id" parameter from "monitor_notification_rule.data.id"
244236
And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}", "host:abc"]}, "name": "updated rule", "recipients": ["@slack-test-channel"]}, "id": "{{ monitor_notification_rule.data.id }}", "type": "monitor-notification-rule"}}
@@ -247,17 +239,15 @@ Feature: Monitors
247239

248240
@team:DataDog/monitor-app
249241
Scenario: Update a monitor notification rule returns "Not Found" response
250-
Given operation "UpdateMonitorNotificationRule" enabled
251-
And new "UpdateMonitorNotificationRule" request
242+
Given new "UpdateMonitorNotificationRule" request
252243
And request contains "rule_id" parameter with value "00000000-0000-1234-0000-000000000000"
253244
And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}", "host:abc"]}, "name": "updated rule", "recipients": ["slack-test-channel", "jira-test"]}, "id": "00000000-0000-1234-0000-000000000000", "type": "monitor-notification-rule"}}
254245
When the request is sent
255246
Then the response status is 404 Not Found
256247

257248
@team:DataDog/monitor-app
258249
Scenario: Update a monitor notification rule returns "OK" response
259-
Given operation "UpdateMonitorNotificationRule" enabled
260-
And there is a valid "monitor_notification_rule" in the system
250+
Given there is a valid "monitor_notification_rule" in the system
261251
And new "UpdateMonitorNotificationRule" request
262252
And request contains "rule_id" parameter from "monitor_notification_rule.data.id"
263253
And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}", "host:abc"]}, "name": "updated rule", "recipients": ["slack-test-channel"]}, "id": "{{ monitor_notification_rule.data.id }}", "type": "monitor-notification-rule"}}

services/monitors/README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ import { MonitorsApiV2 } from "@datadog/datadog-api-client-monitors";
2929
import { v2 } from "@datadog/datadog-api-client-monitors";
3030

3131
const configuration = createConfiguration();
32-
// Enable unstable operations
33-
const configurationOpts = {
34-
unstableOperations: {
35-
"MonitorsApi.v2.getMonitorNotificationRules": true
36-
}
37-
}
38-
39-
const configuration = createConfiguration(configurationOpts);
4032
const apiInstance = new MonitorsApiV2(configuration);
4133
const params = {/* parameters */};
4234

services/monitors/src/v2/MonitorsApi.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
103103
): Promise<RequestContext> {
104104
const _config = _options || this.configuration;
105105

106-
if (
107-
!_config.unstableOperations[
108-
"MonitorsApi.v2.createMonitorNotificationRule"
109-
]
110-
) {
111-
throw new Error(
112-
"Unstable operation 'createMonitorNotificationRule' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.createMonitorNotificationRule'] = true`",
113-
);
114-
}
115-
116106
// verify required parameter 'body' is not null or undefined
117107
if (body === null || body === undefined) {
118108
throw new RequiredError("body", "createMonitorNotificationRule");
@@ -267,16 +257,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
267257
): Promise<RequestContext> {
268258
const _config = _options || this.configuration;
269259

270-
if (
271-
!_config.unstableOperations[
272-
"MonitorsApi.v2.deleteMonitorNotificationRule"
273-
]
274-
) {
275-
throw new Error(
276-
"Unstable operation 'deleteMonitorNotificationRule' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.deleteMonitorNotificationRule'] = true`",
277-
);
278-
}
279-
280260
// verify required parameter 'ruleId' is not null or undefined
281261
if (ruleId === null || ruleId === undefined) {
282262
throw new RequiredError("ruleId", "deleteMonitorNotificationRule");
@@ -421,14 +401,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
421401
): Promise<RequestContext> {
422402
const _config = _options || this.configuration;
423403

424-
if (
425-
!_config.unstableOperations["MonitorsApi.v2.getMonitorNotificationRule"]
426-
) {
427-
throw new Error(
428-
"Unstable operation 'getMonitorNotificationRule' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.getMonitorNotificationRule'] = true`",
429-
);
430-
}
431-
432404
// verify required parameter 'ruleId' is not null or undefined
433405
if (ruleId === null || ruleId === undefined) {
434406
throw new RequiredError("ruleId", "getMonitorNotificationRule");
@@ -483,14 +455,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
483455
): Promise<RequestContext> {
484456
const _config = _options || this.configuration;
485457

486-
if (
487-
!_config.unstableOperations["MonitorsApi.v2.getMonitorNotificationRules"]
488-
) {
489-
throw new Error(
490-
"Unstable operation 'getMonitorNotificationRules' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.getMonitorNotificationRules'] = true`",
491-
);
492-
}
493-
494458
// Path Params
495459
const localVarPath = "/api/v2/monitor/notification_rule";
496460

@@ -738,16 +702,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory {
738702
): Promise<RequestContext> {
739703
const _config = _options || this.configuration;
740704

741-
if (
742-
!_config.unstableOperations[
743-
"MonitorsApi.v2.updateMonitorNotificationRule"
744-
]
745-
) {
746-
throw new Error(
747-
"Unstable operation 'updateMonitorNotificationRule' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.updateMonitorNotificationRule'] = true`",
748-
);
749-
}
750-
751705
// verify required parameter 'ruleId' is not null or undefined
752706
if (ruleId === null || ruleId === undefined) {
753707
throw new RequiredError("ruleId", "updateMonitorNotificationRule");

0 commit comments

Comments
 (0)