diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 20e7390da4b..00de42a955a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -54853,9 +54853,6 @@ paths: - monitors_read x-undo: type: safe - x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, - - contact [Datadog support](https://docs.datadoghq.com/help/).' post: description: Creates a monitor notification rule. operationId: CreateMonitorNotificationRule @@ -54916,9 +54913,6 @@ paths: - name: rule_id source: data.id type: unsafe - x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, - - contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/monitor/notification_rule/{rule_id}: delete: description: Deletes a monitor notification rule by `rule_id`. @@ -54962,9 +54956,6 @@ paths: - monitor_config_policy_write x-undo: type: idempotent - x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, - - contact [Datadog support](https://docs.datadoghq.com/help/).' get: description: Returns a monitor notification rule by `rule_id`. operationId: GetMonitorNotificationRule @@ -55021,9 +55012,6 @@ paths: - monitors_read x-undo: type: safe - x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, - - contact [Datadog support](https://docs.datadoghq.com/help/).' patch: description: Updates a monitor notification rule by `rule_id`. operationId: UpdateMonitorNotificationRule @@ -55084,9 +55072,6 @@ paths: - monitor_config_policy_write x-undo: type: idempotent - x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, - - contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/monitor/policy: get: description: Get all monitor configuration policies. diff --git a/features/v2/monitors.feature b/features/v2/monitors.feature index ddc106e02b9..d49f00dd048 100644 --- a/features/v2/monitors.feature +++ b/features/v2/monitors.feature @@ -31,16 +31,14 @@ Feature: Monitors @skip-validation @team:DataDog/monitor-app Scenario: Create a monitor notification rule returns "Bad Request" response - Given operation "CreateMonitorNotificationRule" enabled - And new "CreateMonitorNotificationRule" request + Given new "CreateMonitorNotificationRule" request 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"}} When the request is sent Then the response status is 400 Bad Request @team:DataDog/monitor-app Scenario: Create a monitor notification rule returns "OK" response - Given operation "CreateMonitorNotificationRule" enabled - And new "CreateMonitorNotificationRule" request + Given new "CreateMonitorNotificationRule" request And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}"]}, "name": "test rule", "recipients": ["slack-test-channel", "jira-test"]}, "type": "monitor-notification-rule"}} When the request is sent Then the response status is 200 OK @@ -86,16 +84,14 @@ Feature: Monitors @team:DataDog/monitor-app Scenario: Delete a monitor notification rule returns "Not Found" response - Given operation "DeleteMonitorNotificationRule" enabled - And new "DeleteMonitorNotificationRule" request + Given new "DeleteMonitorNotificationRule" request And request contains "rule_id" parameter with value "00000000-0000-1234-0000-000000000000" When the request is sent Then the response status is 404 Not Found @team:DataDog/monitor-app Scenario: Delete a monitor notification rule returns "OK" response - Given operation "DeleteMonitorNotificationRule" enabled - And there is a valid "monitor_notification_rule" in the system + Given there is a valid "monitor_notification_rule" in the system And new "DeleteMonitorNotificationRule" request And request contains "rule_id" parameter from "monitor_notification_rule.data.id" When the request is sent @@ -170,16 +166,14 @@ Feature: Monitors @team:DataDog/monitor-app Scenario: Get a monitor notification rule returns "Not Found" response - Given operation "GetMonitorNotificationRule" enabled - And new "GetMonitorNotificationRule" request + Given new "GetMonitorNotificationRule" request And request contains "rule_id" parameter with value "00000000-0000-1234-0000-000000000000" When the request is sent Then the response status is 404 Not Found @team:DataDog/monitor-app Scenario: Get a monitor notification rule returns "OK" response - Given operation "GetMonitorNotificationRule" enabled - And there is a valid "monitor_notification_rule" in the system + Given there is a valid "monitor_notification_rule" in the system And new "GetMonitorNotificationRule" request And request contains "rule_id" parameter from "monitor_notification_rule.data.id" When the request is sent @@ -218,8 +212,7 @@ Feature: Monitors @team:DataDog/monitor-app Scenario: Get all monitor notification rules returns "OK" response - Given operation "GetMonitorNotificationRules" enabled - And there is a valid "monitor_notification_rule" in the system + Given there is a valid "monitor_notification_rule" in the system And new "GetMonitorNotificationRules" request When the request is sent Then the response status is 200 OK @@ -237,8 +230,7 @@ Feature: Monitors @skip-validation @team:DataDog/monitor-app Scenario: Update a monitor notification rule returns "Bad Request" response - Given operation "UpdateMonitorNotificationRule" enabled - And there is a valid "monitor_notification_rule" in the system + Given there is a valid "monitor_notification_rule" in the system And new "UpdateMonitorNotificationRule" request And request contains "rule_id" parameter from "monitor_notification_rule.data.id" 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,8 +239,7 @@ Feature: Monitors @team:DataDog/monitor-app Scenario: Update a monitor notification rule returns "Not Found" response - Given operation "UpdateMonitorNotificationRule" enabled - And new "UpdateMonitorNotificationRule" request + Given new "UpdateMonitorNotificationRule" request And request contains "rule_id" parameter with value "00000000-0000-1234-0000-000000000000" 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"}} When the request is sent @@ -256,8 +247,7 @@ Feature: Monitors @team:DataDog/monitor-app Scenario: Update a monitor notification rule returns "OK" response - Given operation "UpdateMonitorNotificationRule" enabled - And there is a valid "monitor_notification_rule" in the system + Given there is a valid "monitor_notification_rule" in the system And new "UpdateMonitorNotificationRule" request And request contains "rule_id" parameter from "monitor_notification_rule.data.id" 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"}} diff --git a/services/monitors/README.md b/services/monitors/README.md index 9761c1b3c00..0ca94b89f47 100644 --- a/services/monitors/README.md +++ b/services/monitors/README.md @@ -29,14 +29,6 @@ import { MonitorsApiV2 } from "@datadog/datadog-api-client-monitors"; import { v2 } from "@datadog/datadog-api-client-monitors"; const configuration = createConfiguration(); -// Enable unstable operations -const configurationOpts = { - unstableOperations: { - "MonitorsApi.v2.getMonitorNotificationRules": true - } -} - -const configuration = createConfiguration(configurationOpts); const apiInstance = new MonitorsApiV2(configuration); const params = {/* parameters */}; diff --git a/services/monitors/src/v2/MonitorsApi.ts b/services/monitors/src/v2/MonitorsApi.ts index 9e741d61514..447a759f4fb 100644 --- a/services/monitors/src/v2/MonitorsApi.ts +++ b/services/monitors/src/v2/MonitorsApi.ts @@ -103,16 +103,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations[ - "MonitorsApi.v2.createMonitorNotificationRule" - ] - ) { - throw new Error( - "Unstable operation 'createMonitorNotificationRule' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.createMonitorNotificationRule'] = true`", - ); - } - // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError("body", "createMonitorNotificationRule"); @@ -267,16 +257,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations[ - "MonitorsApi.v2.deleteMonitorNotificationRule" - ] - ) { - throw new Error( - "Unstable operation 'deleteMonitorNotificationRule' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.deleteMonitorNotificationRule'] = true`", - ); - } - // verify required parameter 'ruleId' is not null or undefined if (ruleId === null || ruleId === undefined) { throw new RequiredError("ruleId", "deleteMonitorNotificationRule"); @@ -421,14 +401,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations["MonitorsApi.v2.getMonitorNotificationRule"] - ) { - throw new Error( - "Unstable operation 'getMonitorNotificationRule' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.getMonitorNotificationRule'] = true`", - ); - } - // verify required parameter 'ruleId' is not null or undefined if (ruleId === null || ruleId === undefined) { throw new RequiredError("ruleId", "getMonitorNotificationRule"); @@ -483,14 +455,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations["MonitorsApi.v2.getMonitorNotificationRules"] - ) { - throw new Error( - "Unstable operation 'getMonitorNotificationRules' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.getMonitorNotificationRules'] = true`", - ); - } - // Path Params const localVarPath = "/api/v2/monitor/notification_rule"; @@ -738,16 +702,6 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - if ( - !_config.unstableOperations[ - "MonitorsApi.v2.updateMonitorNotificationRule" - ] - ) { - throw new Error( - "Unstable operation 'updateMonitorNotificationRule' is disabled. Enable it by setting `configuration.unstableOperations['MonitorsApi.v2.updateMonitorNotificationRule'] = true`", - ); - } - // verify required parameter 'ruleId' is not null or undefined if (ruleId === null || ruleId === undefined) { throw new RequiredError("ruleId", "updateMonitorNotificationRule");