From ee15f5c74e1ff2ed2ec4c6602d742d74c58de283 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 15 Apr 2025 21:56:13 +0000 Subject: [PATCH] Regenerate client from commit 808cf2c3 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 446 +++++++++ .../frozen.json | 1 + .../recording.har | 67 ++ .../frozen.json | 1 + .../recording.har | 109 +++ .../frozen.json | 1 + .../recording.har | 57 ++ .../frozen.json | 1 + .../recording.har | 152 ++++ .../frozen.json | 1 + .../recording.har | 57 ++ .../frozen.json | 1 + .../recording.har | 152 ++++ .../frozen.json | 1 + .../recording.har | 152 ++++ .../frozen.json | 1 + .../recording.har | 162 ++++ .../frozen.json | 1 + .../recording.har | 67 ++ .../frozen.json | 1 + .../recording.har | 162 ++++ .../frozen.json | 1 + .../recording.har | 67 ++ .../frozen.json | 1 + .../recording.har | 109 +++ .../frozen.json | 1 + .../recording.har | 57 ++ .../frozen.json | 1 + .../recording.har | 152 ++++ .../frozen.json | 1 + .../recording.har | 57 ++ .../frozen.json | 1 + .../recording.har | 152 ++++ .../frozen.json | 1 + .../recording.har | 152 ++++ .../frozen.json | 1 + .../recording.har | 162 ++++ .../frozen.json | 1 + .../recording.har | 67 ++ .../frozen.json | 1 + .../recording.har | 162 ++++ .../monitors/CreateMonitorNotificationRule.ts | 33 + .../monitors/DeleteMonitorNotificationRule.ts | 26 + .../v2/monitors/GetMonitorNotificationRule.ts | 26 + .../monitors/GetMonitorNotificationRules.ts | 18 + .../monitors/UpdateMonitorNotificationRule.ts | 39 + features/support/scenarios_model_mapping.ts | 43 + features/v2/given.json | 12 + features/v2/monitors.feature | 92 ++ features/v2/undo.json | 37 + .../configuration.ts | 5 + .../datadog-api-client-v2/apis/MonitorsApi.ts | 853 ++++++++++++++++-- packages/datadog-api-client-v2/index.ts | 21 + .../MonitorNotificationRuleAttributes.ts | 60 ++ .../MonitorNotificationRuleCreateRequest.ts | 54 ++ ...onitorNotificationRuleCreateRequestData.ts | 63 ++ .../models/MonitorNotificationRuleData.ts | 79 ++ .../models/MonitorNotificationRuleFilter.ts | 16 + .../MonitorNotificationRuleFilterTags.ts | 42 + .../MonitorNotificationRuleListResponse.ts | 62 ++ .../MonitorNotificationRuleRelationships.ts | 53 ++ ...rNotificationRuleRelationshipsCreatedBy.ts | 53 ++ ...ificationRuleRelationshipsCreatedByData.ts | 61 ++ .../MonitorNotificationRuleResourceType.ts | 16 + .../models/MonitorNotificationRuleResponse.ts | 62 ++ ...nitorNotificationRuleResponseAttributes.ts | 87 ++ ...torNotificationRuleResponseIncludedItem.ts | 14 + .../MonitorNotificationRuleUpdateRequest.ts | 54 ++ ...onitorNotificationRuleUpdateRequestData.ts | 72 ++ .../models/ObjectSerializer.ts | 34 + 71 files changed, 4769 insertions(+), 66 deletions(-) create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-OK-response_4074573173/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-OK-response_4074573173/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-OK-response_4219134527/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-OK-response_4219134527/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Get-all-monitor-notification-rules-returns-OK-response_912909456/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Get-all-monitor-notification-rules-returns-OK-response_912909456/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/recording.har create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-OK-response_1555896012/frozen.json create mode 100644 cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-OK-response_1555896012/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-OK-response_4074573173/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-OK-response_4074573173/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-OK-response_4219134527/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-OK-response_4219134527/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Get-all-monitor-notification-rules-returns-OK-response_912909456/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Get-all-monitor-notification-rules-returns-OK-response_912909456/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/recording.har create mode 100644 cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-OK-response_1555896012/frozen.json create mode 100644 cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-OK-response_1555896012/recording.har create mode 100644 examples/v2/monitors/CreateMonitorNotificationRule.ts create mode 100644 examples/v2/monitors/DeleteMonitorNotificationRule.ts create mode 100644 examples/v2/monitors/GetMonitorNotificationRule.ts create mode 100644 examples/v2/monitors/GetMonitorNotificationRules.ts create mode 100644 examples/v2/monitors/UpdateMonitorNotificationRule.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleCreateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleCreateRequestData.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleData.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleFilter.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleFilterTags.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleListResponse.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationshipsCreatedBy.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationshipsCreatedByData.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleResourceType.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleResponse.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleResponseAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleResponseIncludedItem.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleUpdateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/MonitorNotificationRuleUpdateRequestData.ts diff --git a/.apigentools-info b/.apigentools-info index d2ad44a3fc57..d16bac8b4df4 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-04-15 16:46:15.228355", - "spec_repo_commit": "2d6e55b2" + "regenerated": "2025-04-15 21:54:39.500892", + "spec_repo_commit": "808cf2c3" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-04-15 16:46:15.246175", - "spec_repo_commit": "2d6e55b2" + "regenerated": "2025-04-15 21:54:39.516293", + "spec_repo_commit": "808cf2c3" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6f7970cbbecb..12445d025208 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21371,6 +21371,201 @@ components: type: $ref: '#/components/schemas/MonitorDowntimeMatchResourceType' type: object + MonitorNotificationRuleAttributes: + additionalProperties: false + description: Attributes of the monitor notification rule. + properties: + filter: + $ref: '#/components/schemas/MonitorNotificationRuleFilter' + name: + $ref: '#/components/schemas/MonitorNotificationRuleName' + recipients: + $ref: '#/components/schemas/MonitorNotificationRuleRecipients' + required: + - name + - recipients + type: object + MonitorNotificationRuleCreateRequest: + description: Request for creating a monitor notification rule. + properties: + data: + $ref: '#/components/schemas/MonitorNotificationRuleCreateRequestData' + required: + - data + type: object + MonitorNotificationRuleCreateRequestData: + description: Object to create a monitor notification rule. + properties: + attributes: + $ref: '#/components/schemas/MonitorNotificationRuleAttributes' + type: + $ref: '#/components/schemas/MonitorNotificationRuleResourceType' + required: + - attributes + type: object + MonitorNotificationRuleData: + description: Monitor notification rule data. + properties: + attributes: + $ref: '#/components/schemas/MonitorNotificationRuleResponseAttributes' + id: + $ref: '#/components/schemas/MonitorNotificationRuleId' + relationships: + $ref: '#/components/schemas/MonitorNotificationRuleRelationships' + type: + $ref: '#/components/schemas/MonitorNotificationRuleResourceType' + type: object + MonitorNotificationRuleFilter: + description: Filter used to associate the notification rule with monitors. + oneOf: + - $ref: '#/components/schemas/MonitorNotificationRuleFilterTags' + MonitorNotificationRuleFilterTags: + additionalProperties: false + description: Filter monitors by tags. Monitors must match all tags. + properties: + tags: + description: A list of monitor tags. + example: + - team:product + - host:abc + items: + maxLength: 255 + type: string + maxItems: 20 + minItems: 1 + type: array + uniqueItems: true + required: + - tags + type: object + MonitorNotificationRuleId: + description: The ID of the monitor notification rule. + example: 00000000-0000-1234-0000-000000000000 + type: string + MonitorNotificationRuleListResponse: + description: Response for retrieving all monitor notification rules. + properties: + data: + description: A list of monitor notification rules. + items: + $ref: '#/components/schemas/MonitorNotificationRuleData' + type: array + included: + description: Array of objects related to the monitor notification rules. + items: + $ref: '#/components/schemas/MonitorNotificationRuleResponseIncludedItem' + type: array + type: object + MonitorNotificationRuleName: + description: The name of the monitor notification rule. + example: A notification rule name + maxLength: 1000 + minLength: 1 + type: string + MonitorNotificationRuleRecipients: + description: A list of recipients to notify. Uses the same format as the monitor + `message` field. Must not start with an '@'. + example: + - slack-test-channel + - jira-test + items: + description: individual recipient. + maxLength: 255 + type: string + maxItems: 20 + minItems: 1 + type: array + uniqueItems: true + MonitorNotificationRuleRelationships: + description: All relationships associated with monitor notification rule. + properties: + created_by: + $ref: '#/components/schemas/MonitorNotificationRuleRelationshipsCreatedBy' + type: object + MonitorNotificationRuleRelationshipsCreatedBy: + description: The user who created the monitor notification rule. + properties: + data: + $ref: '#/components/schemas/MonitorNotificationRuleRelationshipsCreatedByData' + type: object + MonitorNotificationRuleRelationshipsCreatedByData: + description: Data for the user who created the monitor notification rule. + nullable: true + properties: + id: + description: User ID of the monitor notification rule creator. + example: 00000000-0000-1234-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/UsersType' + type: object + MonitorNotificationRuleResourceType: + default: monitor-notification-rule + description: Monitor notification rule resource type. + enum: + - monitor-notification-rule + example: monitor-notification-rule + type: string + x-enum-varnames: + - MONITOR_NOTIFICATION_RULE + MonitorNotificationRuleResponse: + description: A monitor notification rule. + properties: + data: + $ref: '#/components/schemas/MonitorNotificationRuleData' + included: + description: Array of objects related to the monitor notification rule that + the user requested. + items: + $ref: '#/components/schemas/MonitorNotificationRuleResponseIncludedItem' + type: array + type: object + MonitorNotificationRuleResponseAttributes: + additionalProperties: {} + description: Attributes of the monitor notification rule. + properties: + created: + description: Creation time of the monitor notification rule. + example: 2020-01-02 03:04:00+00:00 + format: date-time + type: string + filter: + $ref: '#/components/schemas/MonitorNotificationRuleFilter' + modified: + description: Time the monitor notification rule was last modified. + example: 2020-01-02 03:04:00+00:00 + format: date-time + type: string + name: + $ref: '#/components/schemas/MonitorNotificationRuleName' + recipients: + $ref: '#/components/schemas/MonitorNotificationRuleRecipients' + type: object + MonitorNotificationRuleResponseIncludedItem: + description: An object related to a monitor notification rule. + oneOf: + - $ref: '#/components/schemas/User' + MonitorNotificationRuleUpdateRequest: + description: Request for updating a monitor notification rule. + properties: + data: + $ref: '#/components/schemas/MonitorNotificationRuleUpdateRequestData' + required: + - data + type: object + MonitorNotificationRuleUpdateRequestData: + description: Object to update a monitor notification rule. + properties: + attributes: + $ref: '#/components/schemas/MonitorNotificationRuleAttributes' + id: + $ref: '#/components/schemas/MonitorNotificationRuleId' + type: + $ref: '#/components/schemas/MonitorNotificationRuleResourceType' + required: + - id + - attributes + type: object MonitorTrigger: description: Trigger a workflow from a Monitor. For automatic triggering a handle must be configured and the workflow must be published. @@ -35806,6 +36001,7 @@ components: incident_settings_write: Configure Incident Settings. incident_write: Create, view, and manage incidents in Datadog. metrics_read: View custom metrics. + monitor_config_policy_write: Edit and delete monitor configuration. monitors_downtime: Set downtimes to suppress alerts from any monitor in an organization. Mute and unmute monitors. The ability to write monitors is not required to set downtimes. @@ -45721,6 +45917,256 @@ paths: x-permission: operator: OPEN permissions: [] + /api/v2/monitor/notification_rule: + get: + description: Returns a list of all monitor notification rules. + operationId: GetMonitorNotificationRules + parameters: + - description: 'Comma-separated list of resource paths for related resources + to include in the response. Supported resource + + path is `created_by`.' + in: query + name: include + required: false + schema: + example: created_by + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorNotificationRuleListResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - monitors_read + summary: Get all monitor notification rules + tags: + - Monitors + x-permission: + operator: OR + permissions: + - monitors_read + 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 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorNotificationRuleCreateRequest' + description: Request body to create a monitor notification rule. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorNotificationRuleResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - monitor_config_policy_write + summary: Create a monitor notification rule + tags: + - Monitors + x-permission: + operator: OR + permissions: + - monitor_config_policy_write + 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`. + operationId: DeleteMonitorNotificationRule + parameters: + - description: ID of the monitor notification rule to delete. + in: path + name: rule_id + required: true + schema: + type: string + responses: + '204': + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - monitor_config_policy_write + summary: Delete a monitor notification rule + tags: + - Monitors + x-permission: + operator: OR + permissions: + - monitor_config_policy_write + 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 + parameters: + - description: ID of the monitor notification rule to fetch. + in: path + name: rule_id + required: true + schema: + type: string + - description: 'Comma-separated list of resource paths for related resources + to include in the response. Supported resource + + path is `created_by`.' + in: query + name: include + required: false + schema: + example: created_by + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorNotificationRuleResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - monitors_read + summary: Get a monitor notification rule + tags: + - Monitors + x-permission: + operator: OR + permissions: + - monitors_read + 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 + parameters: + - description: ID of the monitor notification rule to update. + in: path + name: rule_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorNotificationRuleUpdateRequest' + description: Request body to update the monitor notification rule. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorNotificationRuleResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - monitor_config_policy_write + summary: Update a monitor notification rule + tags: + - Monitors + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - monitor_config_policy_write + 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/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/frozen.json new file mode 100644 index 000000000000..ee877b56e4e3 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:02.871Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/recording.har new file mode 100644 index 000000000000..e3ae5c4366a5 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Create a monitor notification rule returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "91ecd1734dcb846d34f51fa07a268817", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 247, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_returns_bad_request_response-1743713882\",\"host:abc\"]},\"name\":\"test rule\",\"recipients\":[\"@slack-test-channel\",\"@jira-test\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 77, + "content": { + "mimeType": "application/json", + "size": 77, + "text": "{\"errors\":[\"Invalid recipients: Recipient handle should not start with '@'\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-04-03T20:58:02.879Z", + "time": 120 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-OK-response_4074573173/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-OK-response_4074573173/frozen.json new file mode 100644 index 000000000000..3f0cddf4006f --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-OK-response_4074573173/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:03.005Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-OK-response_4074573173/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-OK-response_4074573173/recording.har new file mode 100644 index 000000000000..df5090e49754 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Create-a-monitor-notification-rule-returns-OK-response_4074573173/recording.har @@ -0,0 +1,109 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Create a monitor notification rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "e2497b6504619eaa5eeb36c854d59233", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 225, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_returns_ok_response-1743713883\"]},\"name\":\"test rule\",\"recipients\":[\"slack-test-channel\",\"jira-test\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 414, + "content": { + "mimeType": "application/json", + "size": 414, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"id\":\"55959a04-463a-4579-8386-8c2ca120aa52\",\"attributes\":{\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_returns_ok_response-1743713883\"]},\"created_at\":\"2025-04-03T20:58:03.137650+00:00\",\"recipients\":[\"slack-test-channel\",\"jira-test\"],\"name\":\"test rule\",\"modified_at\":\"1970-01-01T00:00:00+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:03.007Z", + "time": 167 + }, + { + "_id": "279a9a1ed299a6cc4bf42d7bc46bd358", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/55959a04-463a-4579-8386-8c2ca120aa52" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-03T20:58:03.182Z", + "time": 137 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/frozen.json new file mode 100644 index 000000000000..fbf23d34b216 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:03.324Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/recording.har new file mode 100644 index 000000000000..d860ff907b55 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Delete a monitor notification rule returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "f20498bf1a3ec9d70f5a6a495ad1e2d1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/00000000-0000-1234-0000-000000000000" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "application/json", + "size": 50, + "text": "{\"errors\":[\"Monitor notification rule not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-03T20:58:03.326Z", + "time": 96 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/frozen.json new file mode 100644 index 000000000000..2cde6e233ed6 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:03.428Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/recording.har new file mode 100644 index 000000000000..fccc9b1775c7 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Delete a monitor notification rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "cc9c5eec9fe056136313f12924098385", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 211, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-delete_a_monitor_notification_rule_returns_ok_response-1743713883\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 400, + "content": { + "mimeType": "application/json", + "size": 400, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"id\":\"cef4c2c7-27b3-4259-9bdd-ec434b4a8a0e\",\"attributes\":{\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"name\":\"test rule\",\"created_at\":\"2025-04-03T20:58:03.555501+00:00\",\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"filter\":{\"tags\":[\"app:test-delete_a_monitor_notification_rule_returns_ok_response-1743713883\"]},\"recipients\":[\"slack-monitor-app\"]}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:03.431Z", + "time": 158 + }, + { + "_id": "48ef7220800a880b4825cf5ede8d013f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/cef4c2c7-27b3-4259-9bdd-ec434b4a8a0e" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-03T20:58:03.595Z", + "time": 151 + }, + { + "_id": "48ef7220800a880b4825cf5ede8d013f", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/cef4c2c7-27b3-4259-9bdd-ec434b4a8a0e" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "application/json", + "size": 50, + "text": "{\"errors\":[\"Monitor notification rule not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-03T20:58:03.752Z", + "time": 127 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/frozen.json new file mode 100644 index 000000000000..ba6325369393 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:03.884Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/recording.har new file mode 100644 index 000000000000..56d57205d2cf --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Get a monitor notification rule returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "62086be36bd795961d12378b821b339e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 569, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/00000000-0000-1234-0000-000000000000" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "application/json", + "size": 50, + "text": "{\"errors\":[\"Monitor notification rule not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 668, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-03T20:58:03.887Z", + "time": 114 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-OK-response_4219134527/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-OK-response_4219134527/frozen.json new file mode 100644 index 000000000000..ad44fddb8817 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-OK-response_4219134527/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:04.007Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-OK-response_4219134527/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-OK-response_4219134527/recording.har new file mode 100644 index 000000000000..fc87e45907ef --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-a-monitor-notification-rule-returns-OK-response_4219134527/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Get a monitor notification rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "7956666ea8eb6ba9d7a58073d1a5aa7c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 208, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-get_a_monitor_notification_rule_returns_ok_response-1743713884\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 397, + "content": { + "mimeType": "application/json", + "size": 397, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"tags\":[\"app:test-get_a_monitor_notification_rule_returns_ok_response-1743713884\"]},\"created_at\":\"2025-04-03T20:58:04.156763+00:00\",\"recipients\":[\"slack-monitor-app\"],\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"name\":\"test rule\"},\"id\":\"8e0ab047-d891-476c-8fb1-da4d80ddc129\"}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:04.010Z", + "time": 177 + }, + { + "_id": "18f18e6df41da00253ccccacf6a8bbd4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 569, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/8e0ab047-d891-476c-8fb1-da4d80ddc129" + }, + "response": { + "bodySize": 404, + "content": { + "mimeType": "application/json", + "size": 404, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"name\":\"test rule\",\"created_at\":\"2025-04-03T20:58:04.156763+00:00\",\"recipients\":[\"slack-monitor-app\"],\"modified_at\":\"2025-04-03T20:58:04.164001+00:00\",\"filter\":{\"tags\":[\"app:test-get_a_monitor_notification_rule_returns_ok_response-1743713884\"]}},\"id\":\"8e0ab047-d891-476c-8fb1-da4d80ddc129\"}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 669, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:04.193Z", + "time": 143 + }, + { + "_id": "a29e4653017286a061b2e0de4a552934", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/8e0ab047-d891-476c-8fb1-da4d80ddc129" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-03T20:58:04.343Z", + "time": 139 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Get-all-monitor-notification-rules-returns-OK-response_912909456/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-all-monitor-notification-rules-returns-OK-response_912909456/frozen.json new file mode 100644 index 000000000000..d4adc57ef79d --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-all-monitor-notification-rules-returns-OK-response_912909456/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:04.487Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Get-all-monitor-notification-rules-returns-OK-response_912909456/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-all-monitor-notification-rules-returns-OK-response_912909456/recording.har new file mode 100644 index 000000000000..de76f4c3e5dd --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Get-all-monitor-notification-rules-returns-OK-response_912909456/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Get all monitor notification rules returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "52a915ad0612ed1dfab9ff3f6f2cbc61", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 211, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-get_all_monitor_notification_rules_returns_ok_response-1743713884\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 400, + "content": { + "mimeType": "application/json", + "size": 400, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"tags\":[\"app:test-get_all_monitor_notification_rules_returns_ok_response-1743713884\"]},\"recipients\":[\"slack-monitor-app\"],\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"name\":\"test rule\",\"created_at\":\"2025-04-03T20:58:04.604345+00:00\"},\"id\":\"6e5b7a93-37b5-44b8-9098-2d31b6dd84b6\"}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:04.490Z", + "time": 150 + }, + { + "_id": "ed428a190762a016a6b7d421239edb39", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 533, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 409, + "content": { + "mimeType": "application/json", + "size": 409, + "text": "{\"data\":[{\"type\":\"monitor-notification-rule\",\"id\":\"6e5b7a93-37b5-44b8-9098-2d31b6dd84b6\",\"attributes\":{\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"],\"created_at\":\"2025-04-03T20:58:04.604345+00:00\",\"filter\":{\"tags\":[\"app:test-get_all_monitor_notification_rules_returns_ok_response-1743713884\"]},\"modified_at\":\"2025-04-03T20:58:04.616893+00:00\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 670, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:04.646Z", + "time": 131 + }, + { + "_id": "e335b389b13ae7868b40c0c8d57b491b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/6e5b7a93-37b5-44b8-9098-2d31b6dd84b6" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-03T20:58:04.783Z", + "time": 165 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/frozen.json new file mode 100644 index 000000000000..cba19cdf9d8b --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:04.953Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/recording.har new file mode 100644 index 000000000000..5050605e8299 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/recording.har @@ -0,0 +1,162 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Update a monitor notification rule returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "291abe792f344a727e100188a03f04b1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 220, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_returns_bad_request_response-1743713884\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 409, + "content": { + "mimeType": "application/json", + "size": 409, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_returns_bad_request_response-1743713884\"]},\"recipients\":[\"slack-monitor-app\"],\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"name\":\"test rule\",\"created_at\":\"2025-04-03T20:58:05.080336+00:00\"},\"id\":\"30523422-5ed5-477d-b310-211ab89031dc\"}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:04.955Z", + "time": 164 + }, + { + "_id": "5ddf7d506e7f48703ff1edbbee9db1bf", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 281, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_returns_bad_request_response-1743713884\",\"host:abc\"]},\"name\":\"updated rule\",\"recipients\":[\"@slack-test-channel\"]},\"id\":\"30523422-5ed5-477d-b310-211ab89031dc\",\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/30523422-5ed5-477d-b310-211ab89031dc" + }, + "response": { + "bodySize": 77, + "content": { + "mimeType": "application/json", + "size": 77, + "text": "{\"errors\":[\"Invalid recipients: Recipient handle should not start with '@'\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-04-03T20:58:05.125Z", + "time": 207 + }, + { + "_id": "0267be28e973f0d1fb9f113dc17cceed", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/30523422-5ed5-477d-b310-211ab89031dc" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-03T20:58:05.336Z", + "time": 106 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/frozen.json new file mode 100644 index 000000000000..06f7dd124f41 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:05.447Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/recording.har new file mode 100644 index 000000000000..9b0db783544b --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Update a monitor notification rule returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "dbb1eee5d6e5291a33022dbb6966f098", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 290, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_returns_not_found_response-1743713885\",\"host:abc\"]},\"name\":\"updated rule\",\"recipients\":[\"slack-test-channel\",\"jira-test\"]},\"id\":\"00000000-0000-1234-0000-000000000000\",\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/00000000-0000-1234-0000-000000000000" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "application/json", + "size": 50, + "text": "{\"errors\":[\"Monitor notification rule not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-03T20:58:05.450Z", + "time": 141 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-OK-response_1555896012/frozen.json b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-OK-response_1555896012/frozen.json new file mode 100644 index 000000000000..e28001f115cc --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-OK-response_1555896012/frozen.json @@ -0,0 +1 @@ +"2025-04-03T20:58:05.597Z" diff --git a/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-OK-response_1555896012/recording.har b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-OK-response_1555896012/recording.har new file mode 100644 index 000000000000..940926ecd2a4 --- /dev/null +++ b/cassettes/v2/Monitor-Notification-Rules_535477875/Update-a-monitor-notification-rule-returns-OK-response_1555896012/recording.har @@ -0,0 +1,162 @@ +{ + "log": { + "_recordingName": "Monitor Notification Rules/Update a monitor notification rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "262c09851992c2c860ce8a875d60bd21", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 211, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_returns_ok_response-1743713885\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 400, + "content": { + "mimeType": "application/json", + "size": 400, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"recipients\":[\"slack-monitor-app\"],\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"created_at\":\"2025-04-03T20:58:05.737805+00:00\",\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_returns_ok_response-1743713885\"]},\"name\":\"test rule\"},\"id\":\"f81c2483-18e3-4db3-ad1d-56e2e0ce41ef\"}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:05.599Z", + "time": 167 + }, + { + "_id": "e43745b329e0a35d86d7f62588218297", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 271, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_returns_ok_response-1743713885\",\"host:abc\"]},\"name\":\"updated rule\",\"recipients\":[\"slack-test-channel\"]},\"id\":\"f81c2483-18e3-4db3-ad1d-56e2e0ce41ef\",\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/f81c2483-18e3-4db3-ad1d-56e2e0ce41ef" + }, + "response": { + "bodySize": 423, + "content": { + "mimeType": "application/json", + "size": 423, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"recipients\":[\"slack-test-channel\"],\"created_at\":\"2025-04-03T20:58:05.737806+00:00\",\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_returns_ok_response-1743713885\",\"host:abc\"]},\"name\":\"updated rule\",\"modified_at\":\"2025-04-03T20:58:05.889695+00:00\",\"creator_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"},\"id\":\"f81c2483-18e3-4db3-ad1d-56e2e0ce41ef\"}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-03T20:58:05.770Z", + "time": 144 + }, + { + "_id": "9a92524ca08caf2b307cc3d6d7653049", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/f81c2483-18e3-4db3-ad1d-56e2e0ce41ef" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-03T20:58:05.918Z", + "time": 139 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/frozen.json b/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/frozen.json new file mode 100644 index 000000000000..f57d4af8f595 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:43.940Z" diff --git a/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/recording.har b/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/recording.har new file mode 100644 index 000000000000..bef5680c47f8 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-Bad-Request-response_3660682105/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Monitors/Create a monitor notification rule returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "ca71586318d98dabd956c3de955ebfc6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 247, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_returns_bad_request_response-1744280983\",\"host:abc\"]},\"name\":\"test rule\",\"recipients\":[\"@slack-test-channel\",\"@jira-test\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 77, + "content": { + "mimeType": "application/json", + "size": 77, + "text": "{\"errors\":[\"Invalid recipients: Recipient handle should not start with '@'\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-04-10T10:29:43.945Z", + "time": 319 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-OK-response_4074573173/frozen.json b/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-OK-response_4074573173/frozen.json new file mode 100644 index 000000000000..c73fd6832fa2 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-OK-response_4074573173/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:44.273Z" diff --git a/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-OK-response_4074573173/recording.har b/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-OK-response_4074573173/recording.har new file mode 100644 index 000000000000..f295b4675c4e --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Create-a-monitor-notification-rule-returns-OK-response_4074573173/recording.har @@ -0,0 +1,109 @@ +{ + "log": { + "_recordingName": "Monitors/Create a monitor notification rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "662b9e66b48e20b0323313a039dcef82", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 225, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_returns_ok_response-1744280984\"]},\"name\":\"test rule\",\"recipients\":[\"slack-test-channel\",\"jira-test\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 925, + "content": { + "mimeType": "application/json", + "size": 925, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_returns_ok_response-1744280984\"]},\"recipients\":[\"slack-test-channel\",\"jira-test\"],\"name\":\"test rule\",\"created_at\":\"2025-04-10T10:29:44.595607+00:00\",\"modified_at\":\"1970-01-01T00:00:00+00:00\"},\"id\":\"a3323ef6-2a04-4ef9-8de8-cbcff5c3c203\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-04-07T20:19:46.118466+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:44.277Z", + "time": 395 + }, + { + "_id": "2f4a98e8f9f9ea2fa8b4a9806400e47d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/a3323ef6-2a04-4ef9-8de8-cbcff5c3c203" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-10T10:29:44.678Z", + "time": 365 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/frozen.json b/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/frozen.json new file mode 100644 index 000000000000..bdaae8c84b17 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:46.694Z" diff --git a/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/recording.har b/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/recording.har new file mode 100644 index 000000000000..14d22662fd98 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-Not-Found-response_1097502651/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Monitors/Delete a monitor notification rule returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "f20498bf1a3ec9d70f5a6a495ad1e2d1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/00000000-0000-1234-0000-000000000000" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "application/json", + "size": 50, + "text": "{\"errors\":[\"Monitor Notification Rule not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-10T10:29:46.698Z", + "time": 348 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/frozen.json b/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/frozen.json new file mode 100644 index 000000000000..b60b4d04c443 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:47.053Z" diff --git a/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/recording.har b/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/recording.har new file mode 100644 index 000000000000..065d4f6906aa --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Delete-a-monitor-notification-rule-returns-OK-response_1846379362/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Monitors/Delete a monitor notification rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "f29d6b1a139009078849e50300212a7b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 211, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-delete_a_monitor_notification_rule_returns_ok_response-1744280987\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 911, + "content": { + "mimeType": "application/json", + "size": 911, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}},\"attributes\":{\"filter\":{\"tags\":[\"app:test-delete_a_monitor_notification_rule_returns_ok_response-1744280987\"]},\"created_at\":\"2025-04-10T10:29:47.326243+00:00\",\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"],\"modified_at\":\"1970-01-01T00:00:00+00:00\"},\"id\":\"66e399af-c07e-414d-b4f2-93e196d7b7b7\"},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-04-07T20:19:46.118466+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 672, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:47.056Z", + "time": 344 + }, + { + "_id": "eb4ba1cae100619c3b628ac1142bd6df", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/66e399af-c07e-414d-b4f2-93e196d7b7b7" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 659, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-10T10:29:47.406Z", + "time": 371 + }, + { + "_id": "eb4ba1cae100619c3b628ac1142bd6df", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/66e399af-c07e-414d-b4f2-93e196d7b7b7" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "application/json", + "size": 50, + "text": "{\"errors\":[\"Monitor Notification Rule not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-10T10:29:47.784Z", + "time": 334 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/frozen.json b/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/frozen.json new file mode 100644 index 000000000000..218565a369e2 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:52.213Z" diff --git a/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/recording.har b/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/recording.har new file mode 100644 index 000000000000..74560e781cb8 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-Not-Found-response_2785204748/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Monitors/Get a monitor notification rule returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "62086be36bd795961d12378b821b339e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 569, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/00000000-0000-1234-0000-000000000000" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "application/json", + "size": 50, + "text": "{\"errors\":[\"Monitor Notification Rule not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 667, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-10T10:29:52.218Z", + "time": 311 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-OK-response_4219134527/frozen.json b/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-OK-response_4219134527/frozen.json new file mode 100644 index 000000000000..2b8ef9b6bd6f --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-OK-response_4219134527/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:52.537Z" diff --git a/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-OK-response_4219134527/recording.har b/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-OK-response_4219134527/recording.har new file mode 100644 index 000000000000..ab194d47aeb1 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Get-a-monitor-notification-rule-returns-OK-response_4219134527/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Monitors/Get a monitor notification rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "593cae6e8ecc720f3d9737e2a6c63bce", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 208, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-get_a_monitor_notification_rule_returns_ok_response-1744280992\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 908, + "content": { + "mimeType": "application/json", + "size": 908, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"created_at\":\"2025-04-10T10:29:52.938158+00:00\",\"filter\":{\"tags\":[\"app:test-get_a_monitor_notification_rule_returns_ok_response-1744280992\"]},\"recipients\":[\"slack-monitor-app\"],\"name\":\"test rule\",\"modified_at\":\"1970-01-01T00:00:00+00:00\"},\"id\":\"97afb4ac-6953-445f-9a0a-d225673449a6\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-04-07T20:19:46.118466+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:52.543Z", + "time": 471 + }, + { + "_id": "13218d6883b280c6ceb69913c766f95b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 569, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/97afb4ac-6953-445f-9a0a-d225673449a6" + }, + "response": { + "bodySize": 350, + "content": { + "mimeType": "application/json", + "size": 350, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"name\":\"test rule\",\"created_at\":\"2025-04-10T10:29:52.938158+00:00\",\"recipients\":[\"slack-monitor-app\"],\"filter\":{\"tags\":[\"app:test-get_a_monitor_notification_rule_returns_ok_response-1744280992\"]},\"modified_at\":\"2025-04-10T10:29:52.948837+00:00\"},\"id\":\"97afb4ac-6953-445f-9a0a-d225673449a6\"}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 668, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:53.021Z", + "time": 340 + }, + { + "_id": "d9e984e4948baaa6c70788340a9b930f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/97afb4ac-6953-445f-9a0a-d225673449a6" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 658, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-10T10:29:53.370Z", + "time": 440 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Get-all-monitor-notification-rules-returns-OK-response_912909456/frozen.json b/cassettes/v2/Monitors_4022238206/Get-all-monitor-notification-rules-returns-OK-response_912909456/frozen.json new file mode 100644 index 000000000000..787407184488 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Get-all-monitor-notification-rules-returns-OK-response_912909456/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:54.937Z" diff --git a/cassettes/v2/Monitors_4022238206/Get-all-monitor-notification-rules-returns-OK-response_912909456/recording.har b/cassettes/v2/Monitors_4022238206/Get-all-monitor-notification-rules-returns-OK-response_912909456/recording.har new file mode 100644 index 000000000000..3225f83f7af6 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Get-all-monitor-notification-rules-returns-OK-response_912909456/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Monitors/Get all monitor notification rules returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "4231adbcf9e7f24ef44b96ee4320eb78", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 211, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-get_all_monitor_notification_rules_returns_ok_response-1744280994\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 911, + "content": { + "mimeType": "application/json", + "size": 911, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"name\":\"test rule\",\"filter\":{\"tags\":[\"app:test-get_all_monitor_notification_rules_returns_ok_response-1744280994\"]},\"recipients\":[\"slack-monitor-app\"],\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"created_at\":\"2025-04-10T10:29:55.362004+00:00\"},\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}},\"id\":\"b7122864-6517-45d3-8dc1-f226a08dd8f4\"},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-04-07T20:19:46.118466+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:54.941Z", + "time": 503 + }, + { + "_id": "ed428a190762a016a6b7d421239edb39", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 533, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 355, + "content": { + "mimeType": "application/json", + "size": 355, + "text": "{\"data\":[{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"tags\":[\"app:test-get_all_monitor_notification_rules_returns_ok_response-1744280994\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"],\"modified_at\":\"2025-04-10T10:29:55.373154+00:00\",\"created_at\":\"2025-04-10T10:29:55.362004+00:00\"},\"id\":\"b7122864-6517-45d3-8dc1-f226a08dd8f4\"}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 669, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:55.449Z", + "time": 336 + }, + { + "_id": "9f8eb62110d751ea8e560410896e60e9", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/b7122864-6517-45d3-8dc1-f226a08dd8f4" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 658, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-10T10:29:55.793Z", + "time": 410 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/frozen.json b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/frozen.json new file mode 100644 index 000000000000..1eabc407943a --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:56.210Z" diff --git a/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/recording.har b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/recording.har new file mode 100644 index 000000000000..20b89b61c2e7 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Bad-Request-response_2951395270/recording.har @@ -0,0 +1,162 @@ +{ + "log": { + "_recordingName": "Monitors/Update a monitor notification rule returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "dc68b2673b606e549c238bc58515432e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 220, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_returns_bad_request_response-1744280996\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 920, + "content": { + "mimeType": "application/json", + "size": 920, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_returns_bad_request_response-1744280996\"]},\"created_at\":\"2025-04-10T10:29:56.523436+00:00\",\"recipients\":[\"slack-monitor-app\"],\"name\":\"test rule\",\"modified_at\":\"1970-01-01T00:00:00+00:00\"},\"id\":\"f26ba0a6-1e84-4984-b061-4172a25a1332\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-04-07T20:19:46.118466+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:56.217Z", + "time": 378 + }, + { + "_id": "57bf6c51f4db330f379d7d3e18591084", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 281, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_returns_bad_request_response-1744280996\",\"host:abc\"]},\"name\":\"updated rule\",\"recipients\":[\"@slack-test-channel\"]},\"id\":\"f26ba0a6-1e84-4984-b061-4172a25a1332\",\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/f26ba0a6-1e84-4984-b061-4172a25a1332" + }, + "response": { + "bodySize": 77, + "content": { + "mimeType": "application/json", + "size": 77, + "text": "{\"errors\":[\"Invalid recipients: Recipient handle should not start with '@'\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 670, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-04-10T10:29:56.601Z", + "time": 319 + }, + { + "_id": "64bffc53e078952e2d43bfbd00d555dc", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/f26ba0a6-1e84-4984-b061-4172a25a1332" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 658, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-10T10:29:56.927Z", + "time": 331 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/frozen.json b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/frozen.json new file mode 100644 index 000000000000..d29ad70c1dad --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:57.263Z" diff --git a/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/recording.har b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/recording.har new file mode 100644 index 000000000000..04a0cedd742a --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-Not-Found-response_2862065933/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Monitors/Update a monitor notification rule returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "628841caa128299d5e138b1a9470b263", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 290, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_returns_not_found_response-1744280997\",\"host:abc\"]},\"name\":\"updated rule\",\"recipients\":[\"slack-test-channel\",\"jira-test\"]},\"id\":\"00000000-0000-1234-0000-000000000000\",\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/00000000-0000-1234-0000-000000000000" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "application/json", + "size": 50, + "text": "{\"errors\":[\"Monitor Notification Rule not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 670, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-04-10T10:29:57.268Z", + "time": 355 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-OK-response_1555896012/frozen.json b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-OK-response_1555896012/frozen.json new file mode 100644 index 000000000000..1f3deb9791e7 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-OK-response_1555896012/frozen.json @@ -0,0 +1 @@ +"2025-04-10T10:29:57.629Z" diff --git a/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-OK-response_1555896012/recording.har b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-OK-response_1555896012/recording.har new file mode 100644 index 000000000000..e2ae2ddc9764 --- /dev/null +++ b/cassettes/v2/Monitors_4022238206/Update-a-monitor-notification-rule-returns-OK-response_1555896012/recording.har @@ -0,0 +1,162 @@ +{ + "log": { + "_recordingName": "Monitors/Update a monitor notification rule returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "a98f8ac4d010c01c7e07bc74f9c6448f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 211, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 589, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_returns_ok_response-1744280997\"]},\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"]},\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule" + }, + "response": { + "bodySize": 911, + "content": { + "mimeType": "application/json", + "size": 911, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"attributes\":{\"name\":\"test rule\",\"recipients\":[\"slack-monitor-app\"],\"modified_at\":\"1970-01-01T00:00:00+00:00\",\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_returns_ok_response-1744280997\"]},\"created_at\":\"2025-04-10T10:29:57.930349+00:00\"},\"id\":\"da2c8a3b-94ea-49be-a85b-39c5eff99d6a\",\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-04-07T20:19:46.118466+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:57.632Z", + "time": 370 + }, + { + "_id": "5d8a915ad4fbca3f07dbdbf76f88609f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 271, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_returns_ok_response-1744280997\",\"host:abc\"]},\"name\":\"updated rule\",\"recipients\":[\"slack-test-channel\"]},\"id\":\"da2c8a3b-94ea-49be-a85b-39c5eff99d6a\",\"type\":\"monitor-notification-rule\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/da2c8a3b-94ea-49be-a85b-39c5eff99d6a" + }, + "response": { + "bodySize": 934, + "content": { + "mimeType": "application/json", + "size": 934, + "text": "{\"data\":{\"type\":\"monitor-notification-rule\",\"id\":\"da2c8a3b-94ea-49be-a85b-39c5eff99d6a\",\"attributes\":{\"modified_at\":\"2025-04-10T10:29:58.320928+00:00\",\"recipients\":[\"slack-test-channel\"],\"name\":\"updated rule\",\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_returns_ok_response-1744280997\",\"host:abc\"]},\"created_at\":\"2025-04-10T10:29:57.930349+00:00\"},\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2025-04-07T20:19:46.118466+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 671, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-04-10T10:29:58.011Z", + "time": 375 + }, + { + "_id": "730c60e4fa7f30e58a1a146641ea7397", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 562, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/monitor/notification_rule/da2c8a3b-94ea-49be-a85b-39c5eff99d6a" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 658, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-04-10T10:29:58.394Z", + "time": 368 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/monitors/CreateMonitorNotificationRule.ts b/examples/v2/monitors/CreateMonitorNotificationRule.ts new file mode 100644 index 000000000000..88299428b6db --- /dev/null +++ b/examples/v2/monitors/CreateMonitorNotificationRule.ts @@ -0,0 +1,33 @@ +/** + * Create a monitor notification rule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createMonitorNotificationRule"] = true; +const apiInstance = new v2.MonitorsApi(configuration); + +const params: v2.MonitorsApiCreateMonitorNotificationRuleRequest = { + body: { + data: { + attributes: { + filter: { + tags: ["test:example-monitor"], + }, + name: "test rule", + recipients: ["slack-test-channel", "jira-test"], + }, + type: "monitor-notification-rule", + }, + }, +}; + +apiInstance + .createMonitorNotificationRule(params) + .then((data: v2.MonitorNotificationRuleResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/monitors/DeleteMonitorNotificationRule.ts b/examples/v2/monitors/DeleteMonitorNotificationRule.ts new file mode 100644 index 000000000000..be3bf7c1d3c2 --- /dev/null +++ b/examples/v2/monitors/DeleteMonitorNotificationRule.ts @@ -0,0 +1,26 @@ +/** + * Delete a monitor notification rule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.deleteMonitorNotificationRule"] = true; +const apiInstance = new v2.MonitorsApi(configuration); + +// there is a valid "monitor_notification_rule" in the system +const MONITOR_NOTIFICATION_RULE_DATA_ID = process.env + .MONITOR_NOTIFICATION_RULE_DATA_ID as string; + +const params: v2.MonitorsApiDeleteMonitorNotificationRuleRequest = { + ruleId: MONITOR_NOTIFICATION_RULE_DATA_ID, +}; + +apiInstance + .deleteMonitorNotificationRule(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/monitors/GetMonitorNotificationRule.ts b/examples/v2/monitors/GetMonitorNotificationRule.ts new file mode 100644 index 000000000000..5397efcbd3b9 --- /dev/null +++ b/examples/v2/monitors/GetMonitorNotificationRule.ts @@ -0,0 +1,26 @@ +/** + * Get a monitor notification rule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getMonitorNotificationRule"] = true; +const apiInstance = new v2.MonitorsApi(configuration); + +// there is a valid "monitor_notification_rule" in the system +const MONITOR_NOTIFICATION_RULE_DATA_ID = process.env + .MONITOR_NOTIFICATION_RULE_DATA_ID as string; + +const params: v2.MonitorsApiGetMonitorNotificationRuleRequest = { + ruleId: MONITOR_NOTIFICATION_RULE_DATA_ID, +}; + +apiInstance + .getMonitorNotificationRule(params) + .then((data: v2.MonitorNotificationRuleResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/monitors/GetMonitorNotificationRules.ts b/examples/v2/monitors/GetMonitorNotificationRules.ts new file mode 100644 index 000000000000..51928631793f --- /dev/null +++ b/examples/v2/monitors/GetMonitorNotificationRules.ts @@ -0,0 +1,18 @@ +/** + * Get all monitor notification rules returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getMonitorNotificationRules"] = true; +const apiInstance = new v2.MonitorsApi(configuration); + +apiInstance + .getMonitorNotificationRules() + .then((data: v2.MonitorNotificationRuleListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/monitors/UpdateMonitorNotificationRule.ts b/examples/v2/monitors/UpdateMonitorNotificationRule.ts new file mode 100644 index 000000000000..31fc345d20cc --- /dev/null +++ b/examples/v2/monitors/UpdateMonitorNotificationRule.ts @@ -0,0 +1,39 @@ +/** + * Update a monitor notification rule returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateMonitorNotificationRule"] = true; +const apiInstance = new v2.MonitorsApi(configuration); + +// there is a valid "monitor_notification_rule" in the system +const MONITOR_NOTIFICATION_RULE_DATA_ID = process.env + .MONITOR_NOTIFICATION_RULE_DATA_ID as string; + +const params: v2.MonitorsApiUpdateMonitorNotificationRuleRequest = { + body: { + data: { + attributes: { + filter: { + tags: ["test:example-monitor", "host:abc"], + }, + name: "updated rule", + recipients: ["slack-test-channel"], + }, + id: MONITOR_NOTIFICATION_RULE_DATA_ID, + type: "monitor-notification-rule", + }, + }, + ruleId: MONITOR_NOTIFICATION_RULE_DATA_ID, +}; + +apiInstance + .updateMonitorNotificationRule(params) + .then((data: v2.MonitorNotificationRuleResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 88ed4b68a596..6c9f231cba14 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -4884,6 +4884,49 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "IntakePayloadAccepted", }, + "v2.GetMonitorNotificationRules": { + "include": { + "type": "string", + "format": "", + }, + "operationResponseType": "MonitorNotificationRuleListResponse", + }, + "v2.CreateMonitorNotificationRule": { + "body": { + "type": "MonitorNotificationRuleCreateRequest", + "format": "", + }, + "operationResponseType": "MonitorNotificationRuleResponse", + }, + "v2.DeleteMonitorNotificationRule": { + "ruleId": { + "type": "string", + "format": "", + }, + "operationResponseType": "void", + }, + "v2.GetMonitorNotificationRule": { + "ruleId": { + "type": "string", + "format": "", + }, + "include": { + "type": "string", + "format": "", + }, + "operationResponseType": "MonitorNotificationRuleResponse", + }, + "v2.UpdateMonitorNotificationRule": { + "ruleId": { + "type": "string", + "format": "", + }, + "body": { + "type": "MonitorNotificationRuleUpdateRequest", + "format": "", + }, + "operationResponseType": "MonitorNotificationRuleResponse", + }, "v2.ListMonitorConfigPolicies": { "operationResponseType": "MonitorConfigPolicyListResponse", }, diff --git a/features/v2/given.json b/features/v2/given.json index 96c49b616686..9cd4b0450aa8 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -436,6 +436,18 @@ "tag": "Metrics", "operationId": "CreateTagConfiguration" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"monitor-notification-rule\",\n \"attributes\": {\n \"name\":\"test rule\",\n \"filter\": {\n \"tags\": [\n \"app:{{ unique_lower }}\"\n ]\n },\n \"recipients\":[\n \"slack-monitor-app\"\n ]\n }\n }\n}" + } + ], + "step": "there is a valid \"monitor_notification_rule\" in the system", + "key": "monitor_notification_rule", + "tag": "Monitors", + "operationId": "CreateMonitorNotificationRule" + }, { "parameters": [ { diff --git a/features/v2/monitors.feature b/features/v2/monitors.feature index 7585d0663d3e..5620258697d2 100644 --- a/features/v2/monitors.feature +++ b/features/v2/monitors.feature @@ -29,6 +29,23 @@ Feature: Monitors And the response "data.attributes.policy.tag_key" is equal to "{{ unique_lower_alnum }}" And the response "data.attributes.policy.valid_tag_values" is equal to ["prod", "staging"] + @skip-validation @team:DataDog/monitor-app + Scenario: Create a monitor notification rule returns "Bad Request" response + Given operation "CreateMonitorNotificationRule" enabled + And 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 + 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 + And the response "data.attributes.name" is equal to "test rule" + @team:DataDog/monitor-app Scenario: Delete a monitor configuration policy returns "Bad Request" response Given new "DeleteMonitorConfigPolicy" request @@ -51,6 +68,23 @@ Feature: Monitors When the request is sent Then the response status is 204 OK + @team:DataDog/monitor-app + Scenario: Delete a monitor notification rule returns "Not Found" response + Given operation "DeleteMonitorNotificationRule" enabled + And 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 + And new "DeleteMonitorNotificationRule" request + And request contains "rule_id" parameter from "monitor_notification_rule.data.id" + When the request is sent + Then the response status is 204 OK + @team:DataDog/monitor-app Scenario: Edit a monitor configuration policy returns "Not Found" response Given new "UpdateMonitorConfigPolicy" request @@ -102,6 +136,24 @@ Feature: Monitors And the response "data.attributes.policy.tag_key" is equal to "{{ unique_lower_alnum }}" And the response "data.attributes.policy.valid_tag_values" is equal to ["prod", "staging"] + @team:DataDog/monitor-app + Scenario: Get a monitor notification rule returns "Not Found" response + Given operation "GetMonitorNotificationRule" enabled + And 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 + And new "GetMonitorNotificationRule" request + And request contains "rule_id" parameter from "monitor_notification_rule.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "test rule" + @team:DataDog/monitor-app Scenario: Get all monitor configuration policies returns "OK" response Given there is a valid "monitor_configuration_policy" in the system @@ -113,3 +165,43 @@ Feature: Monitors And the response "data" has item with field "attributes.policy_type" with value "tag" And the response "data" has item with field "attributes.policy.tag_key" with value "{{ unique_lower_alnum }}" And the response "data" has item with field "attributes.policy.valid_tag_values" with value ["prod", "staging"] + + @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 + And new "GetMonitorNotificationRules" request + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data" has item with field "attributes.name" with value "test rule" + + @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 + 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/monitor-app + Scenario: Update a monitor notification rule returns "Not Found" response + Given operation "UpdateMonitorNotificationRule" enabled + And 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 + Then the response status is 404 Not Found + + @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 + 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"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "updated rule" diff --git a/features/v2/undo.json b/features/v2/undo.json index 333884a2f322..86a9a7285537 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1671,6 +1671,43 @@ "type": "safe" } }, + "GetMonitorNotificationRules": { + "tag": "Monitors", + "undo": { + "type": "safe" + } + }, + "CreateMonitorNotificationRule": { + "tag": "Monitors", + "undo": { + "operationId": "DeleteMonitorNotificationRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteMonitorNotificationRule": { + "tag": "Monitors", + "undo": { + "type": "idempotent" + } + }, + "GetMonitorNotificationRule": { + "tag": "Monitors", + "undo": { + "type": "safe" + } + }, + "UpdateMonitorNotificationRule": { + "tag": "Monitors", + "undo": { + "type": "idempotent" + } + }, "ListMonitorConfigPolicies": { "tag": "Monitors", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index b9bbdcb16852..54f1c2a0b947 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -263,6 +263,11 @@ export function createConfiguration( "v2.listAWSNamespaces": false, "v2.updateAWSAccount": false, "v2.listAWSLogsServices": false, + "v2.createMonitorNotificationRule": false, + "v2.deleteMonitorNotificationRule": false, + "v2.getMonitorNotificationRule": false, + "v2.getMonitorNotificationRules": false, + "v2.updateMonitorNotificationRule": false, "v2.getAggregatedConnections": false, "v2.cancelHistoricalJob": false, "v2.convertJobResultToSignal": false, diff --git a/packages/datadog-api-client-v2/apis/MonitorsApi.ts b/packages/datadog-api-client-v2/apis/MonitorsApi.ts index 637604b5c150..59b75ae04049 100644 --- a/packages/datadog-api-client-v2/apis/MonitorsApi.ts +++ b/packages/datadog-api-client-v2/apis/MonitorsApi.ts @@ -21,6 +21,10 @@ import { MonitorConfigPolicyCreateRequest } from "../models/MonitorConfigPolicyC import { MonitorConfigPolicyEditRequest } from "../models/MonitorConfigPolicyEditRequest"; import { MonitorConfigPolicyListResponse } from "../models/MonitorConfigPolicyListResponse"; import { MonitorConfigPolicyResponse } from "../models/MonitorConfigPolicyResponse"; +import { MonitorNotificationRuleCreateRequest } from "../models/MonitorNotificationRuleCreateRequest"; +import { MonitorNotificationRuleListResponse } from "../models/MonitorNotificationRuleListResponse"; +import { MonitorNotificationRuleResponse } from "../models/MonitorNotificationRuleResponse"; +import { MonitorNotificationRuleUpdateRequest } from "../models/MonitorNotificationRuleUpdateRequest"; export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { public async createMonitorConfigPolicy( @@ -64,6 +68,59 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async createMonitorNotificationRule( + body: MonitorNotificationRuleCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createMonitorNotificationRule'"); + if (!_config.unstableOperations["v2.createMonitorNotificationRule"]) { + throw new Error( + "Unstable operation 'createMonitorNotificationRule' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createMonitorNotificationRule"); + } + + // Path Params + const localVarPath = "/api/v2/monitor/notification_rule"; + + // Make Request Context + const requestContext = _config + .getServer("v2.MonitorsApi.createMonitorNotificationRule") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "MonitorNotificationRuleCreateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async deleteMonitorConfigPolicy( policyId: string, _options?: Configuration @@ -97,6 +154,47 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async deleteMonitorNotificationRule( + ruleId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteMonitorNotificationRule'"); + if (!_config.unstableOperations["v2.deleteMonitorNotificationRule"]) { + throw new Error( + "Unstable operation 'deleteMonitorNotificationRule' is disabled" + ); + } + + // verify required parameter 'ruleId' is not null or undefined + if (ruleId === null || ruleId === undefined) { + throw new RequiredError("ruleId", "deleteMonitorNotificationRule"); + } + + // Path Params + const localVarPath = "/api/v2/monitor/notification_rule/{rule_id}".replace( + "{rule_id}", + encodeURIComponent(String(ruleId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.MonitorsApi.deleteMonitorNotificationRule") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async getMonitorConfigPolicy( policyId: string, _options?: Configuration @@ -131,6 +229,99 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getMonitorNotificationRule( + ruleId: string, + include?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getMonitorNotificationRule'"); + if (!_config.unstableOperations["v2.getMonitorNotificationRule"]) { + throw new Error( + "Unstable operation 'getMonitorNotificationRule' is disabled" + ); + } + + // verify required parameter 'ruleId' is not null or undefined + if (ruleId === null || ruleId === undefined) { + throw new RequiredError("ruleId", "getMonitorNotificationRule"); + } + + // Path Params + const localVarPath = "/api/v2/monitor/notification_rule/{rule_id}".replace( + "{rule_id}", + encodeURIComponent(String(ruleId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.MonitorsApi.getMonitorNotificationRule") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize(include, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getMonitorNotificationRules( + include?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getMonitorNotificationRules'"); + if (!_config.unstableOperations["v2.getMonitorNotificationRules"]) { + throw new Error( + "Unstable operation 'getMonitorNotificationRules' is disabled" + ); + } + + // Path Params + const localVarPath = "/api/v2/monitor/notification_rule"; + + // Make Request Context + const requestContext = _config + .getServer("v2.MonitorsApi.getMonitorNotificationRules") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize(include, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listMonitorConfigPolicies( _options?: Configuration ): Promise { @@ -173,49 +364,354 @@ export class MonitorsApiRequestFactory extends BaseAPIRequestFactory { throw new RequiredError("body", "updateMonitorConfigPolicy"); } - // Path Params - const localVarPath = "/api/v2/monitor/policy/{policy_id}".replace( - "{policy_id}", - encodeURIComponent(String(policyId)) - ); - - // Make Request Context - const requestContext = _config - .getServer("v2.MonitorsApi.updateMonitorConfigPolicy") - .makeRequestContext(localVarPath, HttpMethod.PATCH); - requestContext.setHeaderParam("Accept", "application/json"); - requestContext.setHttpConfig(_config.httpConfig); + // Path Params + const localVarPath = "/api/v2/monitor/policy/{policy_id}".replace( + "{policy_id}", + encodeURIComponent(String(policyId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.MonitorsApi.updateMonitorConfigPolicy") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "MonitorConfigPolicyEditRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateMonitorNotificationRule( + ruleId: string, + body: MonitorNotificationRuleUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'updateMonitorNotificationRule'"); + if (!_config.unstableOperations["v2.updateMonitorNotificationRule"]) { + throw new Error( + "Unstable operation 'updateMonitorNotificationRule' is disabled" + ); + } + + // verify required parameter 'ruleId' is not null or undefined + if (ruleId === null || ruleId === undefined) { + throw new RequiredError("ruleId", "updateMonitorNotificationRule"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateMonitorNotificationRule"); + } + + // Path Params + const localVarPath = "/api/v2/monitor/notification_rule/{rule_id}".replace( + "{rule_id}", + encodeURIComponent(String(ruleId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.MonitorsApi.updateMonitorNotificationRule") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "MonitorNotificationRuleUpdateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class MonitorsApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createMonitorConfigPolicy + * @throws ApiException if the response code was not in [200, 299] + */ + public async createMonitorConfigPolicy( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: MonitorConfigPolicyResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorConfigPolicyResponse" + ) as MonitorConfigPolicyResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: MonitorConfigPolicyResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorConfigPolicyResponse", + "" + ) as MonitorConfigPolicyResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createMonitorNotificationRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async createMonitorNotificationRule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: MonitorNotificationRuleResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorNotificationRuleResponse" + ) as MonitorNotificationRuleResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: MonitorNotificationRuleResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorNotificationRuleResponse", + "" + ) as MonitorNotificationRuleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteMonitorConfigPolicy + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteMonitorConfigPolicy( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteMonitorNotificationRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteMonitorNotificationRule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + return body; + } - // Body Params - const contentType = ObjectSerializer.getPreferredMediaType([ - "application/json", - ]); - requestContext.setHeaderParam("Content-Type", contentType); - const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(body, "MonitorConfigPolicyEditRequest", ""), - contentType + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' ); - requestContext.setBody(serializedBody); - - // Apply auth methods - applySecurityAuthentication(_config, requestContext, [ - "apiKeyAuth", - "appKeyAuth", - ]); - - return requestContext; } -} -export class MonitorsApiResponseProcessor { /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to createMonitorConfigPolicy + * @params response Response returned by the server for a request to getMonitorConfigPolicy * @throws ApiException if the response code was not in [200, 299] */ - public async createMonitorConfigPolicy( + public async getMonitorConfigPolicy( response: ResponseContext ): Promise { const contentType = ObjectSerializer.normalizeMediaType( @@ -229,8 +725,8 @@ export class MonitorsApiResponseProcessor { return body; } if ( - response.httpStatusCode === 400 || response.httpStatusCode === 403 || + response.httpStatusCode === 404 || response.httpStatusCode === 429 ) { const bodyText = ObjectSerializer.parse( @@ -274,20 +770,24 @@ export class MonitorsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to deleteMonitorConfigPolicy + * @params response Response returned by the server for a request to getMonitorNotificationRule * @throws ApiException if the response code was not in [200, 299] */ - public async deleteMonitorConfigPolicy( + public async getMonitorNotificationRule( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (response.httpStatusCode === 204) { - return; + if (response.httpStatusCode === 200) { + const body: MonitorNotificationRuleResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorNotificationRuleResponse" + ) as MonitorNotificationRuleResponse; + return body; } if ( - response.httpStatusCode === 400 || response.httpStatusCode === 403 || response.httpStatusCode === 404 || response.httpStatusCode === 429 @@ -314,11 +814,12 @@ export class MonitorsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: void = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "void", - "" - ) as void; + const body: MonitorNotificationRuleResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorNotificationRuleResponse", + "" + ) as MonitorNotificationRuleResponse; return body; } @@ -333,27 +834,24 @@ export class MonitorsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getMonitorConfigPolicy + * @params response Response returned by the server for a request to getMonitorNotificationRules * @throws ApiException if the response code was not in [200, 299] */ - public async getMonitorConfigPolicy( + public async getMonitorNotificationRules( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: MonitorConfigPolicyResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "MonitorConfigPolicyResponse" - ) as MonitorConfigPolicyResponse; + const body: MonitorNotificationRuleListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorNotificationRuleListResponse" + ) as MonitorNotificationRuleListResponse; return body; } - if ( - response.httpStatusCode === 403 || - response.httpStatusCode === 404 || - response.httpStatusCode === 429 - ) { + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -376,11 +874,12 @@ export class MonitorsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: MonitorConfigPolicyResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "MonitorConfigPolicyResponse", - "" - ) as MonitorConfigPolicyResponse; + const body: MonitorNotificationRuleListResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorNotificationRuleListResponse", + "" + ) as MonitorNotificationRuleListResponse; return body; } @@ -513,6 +1012,71 @@ export class MonitorsApiResponseProcessor { 'Unknown API Status Code!\nBody: "' + body + '"' ); } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateMonitorNotificationRule + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateMonitorNotificationRule( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: MonitorNotificationRuleResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorNotificationRuleResponse" + ) as MonitorNotificationRuleResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: MonitorNotificationRuleResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MonitorNotificationRuleResponse", + "" + ) as MonitorNotificationRuleResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } } export interface MonitorsApiCreateMonitorConfigPolicyRequest { @@ -523,6 +1087,14 @@ export interface MonitorsApiCreateMonitorConfigPolicyRequest { body: MonitorConfigPolicyCreateRequest; } +export interface MonitorsApiCreateMonitorNotificationRuleRequest { + /** + * Request body to create a monitor notification rule. + * @type MonitorNotificationRuleCreateRequest + */ + body: MonitorNotificationRuleCreateRequest; +} + export interface MonitorsApiDeleteMonitorConfigPolicyRequest { /** * ID of the monitor configuration policy. @@ -531,6 +1103,14 @@ export interface MonitorsApiDeleteMonitorConfigPolicyRequest { policyId: string; } +export interface MonitorsApiDeleteMonitorNotificationRuleRequest { + /** + * ID of the monitor notification rule to delete. + * @type string + */ + ruleId: string; +} + export interface MonitorsApiGetMonitorConfigPolicyRequest { /** * ID of the monitor configuration policy. @@ -539,6 +1119,29 @@ export interface MonitorsApiGetMonitorConfigPolicyRequest { policyId: string; } +export interface MonitorsApiGetMonitorNotificationRuleRequest { + /** + * ID of the monitor notification rule to fetch. + * @type string + */ + ruleId: string; + /** + * Comma-separated list of resource paths for related resources to include in the response. Supported resource + * path is `created_by`. + * @type string + */ + include?: string; +} + +export interface MonitorsApiGetMonitorNotificationRulesRequest { + /** + * Comma-separated list of resource paths for related resources to include in the response. Supported resource + * path is `created_by`. + * @type string + */ + include?: string; +} + export interface MonitorsApiUpdateMonitorConfigPolicyRequest { /** * ID of the monitor configuration policy. @@ -552,6 +1155,19 @@ export interface MonitorsApiUpdateMonitorConfigPolicyRequest { body: MonitorConfigPolicyEditRequest; } +export interface MonitorsApiUpdateMonitorNotificationRuleRequest { + /** + * ID of the monitor notification rule to update. + * @type string + */ + ruleId: string; + /** + * Request body to update the monitor notification rule. + * @type MonitorNotificationRuleUpdateRequest + */ + body: MonitorNotificationRuleUpdateRequest; +} + export class MonitorsApi { private requestFactory: MonitorsApiRequestFactory; private responseProcessor: MonitorsApiResponseProcessor; @@ -592,6 +1208,27 @@ export class MonitorsApi { }); } + /** + * Creates a monitor notification rule. + * @param param The request object + */ + public createMonitorNotificationRule( + param: MonitorsApiCreateMonitorNotificationRuleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createMonitorNotificationRule(param.body, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createMonitorNotificationRule( + responseContext + ); + }); + }); + } + /** * Delete a monitor configuration policy. * @param param The request object @@ -615,6 +1252,27 @@ export class MonitorsApi { }); } + /** + * Deletes a monitor notification rule by `rule_id`. + * @param param The request object + */ + public deleteMonitorNotificationRule( + param: MonitorsApiDeleteMonitorNotificationRuleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.deleteMonitorNotificationRule(param.ruleId, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteMonitorNotificationRule( + responseContext + ); + }); + }); + } + /** * Get a monitor configuration policy by `policy_id`. * @param param The request object @@ -636,6 +1294,52 @@ export class MonitorsApi { }); } + /** + * Returns a monitor notification rule by `rule_id`. + * @param param The request object + */ + public getMonitorNotificationRule( + param: MonitorsApiGetMonitorNotificationRuleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getMonitorNotificationRule( + param.ruleId, + param.include, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getMonitorNotificationRule( + responseContext + ); + }); + }); + } + + /** + * Returns a list of all monitor notification rules. + * @param param The request object + */ + public getMonitorNotificationRules( + param: MonitorsApiGetMonitorNotificationRulesRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getMonitorNotificationRules(param.include, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getMonitorNotificationRules( + responseContext + ); + }); + }); + } + /** * Get all monitor configuration policies. * @param param The request object @@ -679,4 +1383,29 @@ export class MonitorsApi { }); }); } + + /** + * Updates a monitor notification rule by `rule_id`. + * @param param The request object + */ + public updateMonitorNotificationRule( + param: MonitorsApiUpdateMonitorNotificationRuleRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.updateMonitorNotificationRule( + param.ruleId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateMonitorNotificationRule( + responseContext + ); + }); + }); + } } diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 5f021ea7f577..130accaaa7d1 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -387,9 +387,14 @@ export { export { MonitorsApiCreateMonitorConfigPolicyRequest, + MonitorsApiCreateMonitorNotificationRuleRequest, MonitorsApiDeleteMonitorConfigPolicyRequest, + MonitorsApiDeleteMonitorNotificationRuleRequest, MonitorsApiGetMonitorConfigPolicyRequest, + MonitorsApiGetMonitorNotificationRuleRequest, + MonitorsApiGetMonitorNotificationRulesRequest, MonitorsApiUpdateMonitorConfigPolicyRequest, + MonitorsApiUpdateMonitorNotificationRuleRequest, MonitorsApi, } from "./apis/MonitorsApi"; @@ -1991,6 +1996,22 @@ export { MonitorDowntimeMatchResourceType } from "./models/MonitorDowntimeMatchR export { MonitorDowntimeMatchResponse } from "./models/MonitorDowntimeMatchResponse"; export { MonitorDowntimeMatchResponseAttributes } from "./models/MonitorDowntimeMatchResponseAttributes"; export { MonitorDowntimeMatchResponseData } from "./models/MonitorDowntimeMatchResponseData"; +export { MonitorNotificationRuleAttributes } from "./models/MonitorNotificationRuleAttributes"; +export { MonitorNotificationRuleCreateRequest } from "./models/MonitorNotificationRuleCreateRequest"; +export { MonitorNotificationRuleCreateRequestData } from "./models/MonitorNotificationRuleCreateRequestData"; +export { MonitorNotificationRuleData } from "./models/MonitorNotificationRuleData"; +export { MonitorNotificationRuleFilter } from "./models/MonitorNotificationRuleFilter"; +export { MonitorNotificationRuleFilterTags } from "./models/MonitorNotificationRuleFilterTags"; +export { MonitorNotificationRuleListResponse } from "./models/MonitorNotificationRuleListResponse"; +export { MonitorNotificationRuleRelationships } from "./models/MonitorNotificationRuleRelationships"; +export { MonitorNotificationRuleRelationshipsCreatedBy } from "./models/MonitorNotificationRuleRelationshipsCreatedBy"; +export { MonitorNotificationRuleRelationshipsCreatedByData } from "./models/MonitorNotificationRuleRelationshipsCreatedByData"; +export { MonitorNotificationRuleResourceType } from "./models/MonitorNotificationRuleResourceType"; +export { MonitorNotificationRuleResponse } from "./models/MonitorNotificationRuleResponse"; +export { MonitorNotificationRuleResponseAttributes } from "./models/MonitorNotificationRuleResponseAttributes"; +export { MonitorNotificationRuleResponseIncludedItem } from "./models/MonitorNotificationRuleResponseIncludedItem"; +export { MonitorNotificationRuleUpdateRequest } from "./models/MonitorNotificationRuleUpdateRequest"; +export { MonitorNotificationRuleUpdateRequestData } from "./models/MonitorNotificationRuleUpdateRequestData"; export { MonitorTrigger } from "./models/MonitorTrigger"; export { MonitorTriggerWrapper } from "./models/MonitorTriggerWrapper"; export { MonitorType } from "./models/MonitorType"; diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleAttributes.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleAttributes.ts new file mode 100644 index 000000000000..11aedfb84d91 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleAttributes.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleFilter } from "./MonitorNotificationRuleFilter"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the monitor notification rule. + */ +export class MonitorNotificationRuleAttributes { + /** + * Filter used to associate the notification rule with monitors. + */ + "filter"?: MonitorNotificationRuleFilter; + /** + * The name of the monitor notification rule. + */ + "name": string; + /** + * A list of recipients to notify. Uses the same format as the monitor `message` field. Must not start with an '@'. + */ + "recipients": Array; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + filter: { + baseName: "filter", + type: "MonitorNotificationRuleFilter", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + recipients: { + baseName: "recipients", + type: "Array", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleCreateRequest.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleCreateRequest.ts new file mode 100644 index 000000000000..971bc7a3a1a6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleCreateRequestData } from "./MonitorNotificationRuleCreateRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request for creating a monitor notification rule. + */ +export class MonitorNotificationRuleCreateRequest { + /** + * Object to create a monitor notification rule. + */ + "data": MonitorNotificationRuleCreateRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "MonitorNotificationRuleCreateRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleCreateRequestData.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleCreateRequestData.ts new file mode 100644 index 000000000000..62cd68426cb6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleCreateRequestData.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleAttributes } from "./MonitorNotificationRuleAttributes"; +import { MonitorNotificationRuleResourceType } from "./MonitorNotificationRuleResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object to create a monitor notification rule. + */ +export class MonitorNotificationRuleCreateRequestData { + /** + * Attributes of the monitor notification rule. + */ + "attributes": MonitorNotificationRuleAttributes; + /** + * Monitor notification rule resource type. + */ + "type"?: MonitorNotificationRuleResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "MonitorNotificationRuleAttributes", + required: true, + }, + type: { + baseName: "type", + type: "MonitorNotificationRuleResourceType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleCreateRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleData.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleData.ts new file mode 100644 index 000000000000..67efc5cf604e --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleData.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleRelationships } from "./MonitorNotificationRuleRelationships"; +import { MonitorNotificationRuleResourceType } from "./MonitorNotificationRuleResourceType"; +import { MonitorNotificationRuleResponseAttributes } from "./MonitorNotificationRuleResponseAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Monitor notification rule data. + */ +export class MonitorNotificationRuleData { + /** + * Attributes of the monitor notification rule. + */ + "attributes"?: MonitorNotificationRuleResponseAttributes; + /** + * The ID of the monitor notification rule. + */ + "id"?: string; + /** + * All relationships associated with monitor notification rule. + */ + "relationships"?: MonitorNotificationRuleRelationships; + /** + * Monitor notification rule resource type. + */ + "type"?: MonitorNotificationRuleResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "MonitorNotificationRuleResponseAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + relationships: { + baseName: "relationships", + type: "MonitorNotificationRuleRelationships", + }, + type: { + baseName: "type", + type: "MonitorNotificationRuleResourceType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleFilter.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleFilter.ts new file mode 100644 index 000000000000..290da036f7de --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleFilter.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleFilterTags } from "./MonitorNotificationRuleFilterTags"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Filter used to associate the notification rule with monitors. + */ + +export type MonitorNotificationRuleFilter = + | MonitorNotificationRuleFilterTags + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleFilterTags.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleFilterTags.ts new file mode 100644 index 000000000000..a71ef0f26dbb --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleFilterTags.ts @@ -0,0 +1,42 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Filter monitors by tags. Monitors must match all tags. + */ +export class MonitorNotificationRuleFilterTags { + /** + * A list of monitor tags. + */ + "tags": Array; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + tags: { + baseName: "tags", + type: "Array", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleFilterTags.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleListResponse.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleListResponse.ts new file mode 100644 index 000000000000..2035fc606438 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleListResponse.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleData } from "./MonitorNotificationRuleData"; +import { MonitorNotificationRuleResponseIncludedItem } from "./MonitorNotificationRuleResponseIncludedItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response for retrieving all monitor notification rules. + */ +export class MonitorNotificationRuleListResponse { + /** + * A list of monitor notification rules. + */ + "data"?: Array; + /** + * Array of objects related to the monitor notification rules. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationships.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationships.ts new file mode 100644 index 000000000000..f247cac04d06 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationships.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleRelationshipsCreatedBy } from "./MonitorNotificationRuleRelationshipsCreatedBy"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * All relationships associated with monitor notification rule. + */ +export class MonitorNotificationRuleRelationships { + /** + * The user who created the monitor notification rule. + */ + "createdBy"?: MonitorNotificationRuleRelationshipsCreatedBy; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdBy: { + baseName: "created_by", + type: "MonitorNotificationRuleRelationshipsCreatedBy", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationshipsCreatedBy.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationshipsCreatedBy.ts new file mode 100644 index 000000000000..562e15ce4c56 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationshipsCreatedBy.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleRelationshipsCreatedByData } from "./MonitorNotificationRuleRelationshipsCreatedByData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The user who created the monitor notification rule. + */ +export class MonitorNotificationRuleRelationshipsCreatedBy { + /** + * Data for the user who created the monitor notification rule. + */ + "data"?: MonitorNotificationRuleRelationshipsCreatedByData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "MonitorNotificationRuleRelationshipsCreatedByData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleRelationshipsCreatedBy.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationshipsCreatedByData.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationshipsCreatedByData.ts new file mode 100644 index 000000000000..e107b028e862 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleRelationshipsCreatedByData.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { UsersType } from "./UsersType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data for the user who created the monitor notification rule. + */ +export class MonitorNotificationRuleRelationshipsCreatedByData { + /** + * User ID of the monitor notification rule creator. + */ + "id"?: string; + /** + * Users resource type. + */ + "type"?: UsersType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "UsersType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleRelationshipsCreatedByData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleResourceType.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleResourceType.ts new file mode 100644 index 000000000000..d0590b666479 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleResourceType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Monitor notification rule resource type. + */ + +export type MonitorNotificationRuleResourceType = + | typeof MONITOR_NOTIFICATION_RULE + | UnparsedObject; +export const MONITOR_NOTIFICATION_RULE = "monitor-notification-rule"; diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponse.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponse.ts new file mode 100644 index 000000000000..4198ffb1b73b --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponse.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleData } from "./MonitorNotificationRuleData"; +import { MonitorNotificationRuleResponseIncludedItem } from "./MonitorNotificationRuleResponseIncludedItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A monitor notification rule. + */ +export class MonitorNotificationRuleResponse { + /** + * Monitor notification rule data. + */ + "data"?: MonitorNotificationRuleData; + /** + * Array of objects related to the monitor notification rule that the user requested. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "MonitorNotificationRuleData", + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponseAttributes.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponseAttributes.ts new file mode 100644 index 000000000000..1c1dec36bbda --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponseAttributes.ts @@ -0,0 +1,87 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleFilter } from "./MonitorNotificationRuleFilter"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the monitor notification rule. + */ +export class MonitorNotificationRuleResponseAttributes { + /** + * Creation time of the monitor notification rule. + */ + "created"?: Date; + /** + * Filter used to associate the notification rule with monitors. + */ + "filter"?: MonitorNotificationRuleFilter; + /** + * Time the monitor notification rule was last modified. + */ + "modified"?: Date; + /** + * The name of the monitor notification rule. + */ + "name"?: string; + /** + * A list of recipients to notify. Uses the same format as the monitor `message` field. Must not start with an '@'. + */ + "recipients"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + created: { + baseName: "created", + type: "Date", + format: "date-time", + }, + filter: { + baseName: "filter", + type: "MonitorNotificationRuleFilter", + }, + modified: { + baseName: "modified", + type: "Date", + format: "date-time", + }, + name: { + baseName: "name", + type: "string", + }, + recipients: { + baseName: "recipients", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponseIncludedItem.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponseIncludedItem.ts new file mode 100644 index 000000000000..d5db76bac351 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleResponseIncludedItem.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { User } from "./User"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * An object related to a monitor notification rule. + */ + +export type MonitorNotificationRuleResponseIncludedItem = User | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleUpdateRequest.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleUpdateRequest.ts new file mode 100644 index 000000000000..ecb3a721fe23 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleUpdateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleUpdateRequestData } from "./MonitorNotificationRuleUpdateRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request for updating a monitor notification rule. + */ +export class MonitorNotificationRuleUpdateRequest { + /** + * Object to update a monitor notification rule. + */ + "data": MonitorNotificationRuleUpdateRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "MonitorNotificationRuleUpdateRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MonitorNotificationRuleUpdateRequestData.ts b/packages/datadog-api-client-v2/models/MonitorNotificationRuleUpdateRequestData.ts new file mode 100644 index 000000000000..0c18c2eb1a32 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MonitorNotificationRuleUpdateRequestData.ts @@ -0,0 +1,72 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { MonitorNotificationRuleAttributes } from "./MonitorNotificationRuleAttributes"; +import { MonitorNotificationRuleResourceType } from "./MonitorNotificationRuleResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object to update a monitor notification rule. + */ +export class MonitorNotificationRuleUpdateRequestData { + /** + * Attributes of the monitor notification rule. + */ + "attributes": MonitorNotificationRuleAttributes; + /** + * The ID of the monitor notification rule. + */ + "id": string; + /** + * Monitor notification rule resource type. + */ + "type"?: MonitorNotificationRuleResourceType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "MonitorNotificationRuleAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "MonitorNotificationRuleResourceType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MonitorNotificationRuleUpdateRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index ab620277c2b1..1048873a0d9b 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -999,6 +999,19 @@ import { MonitorConfigPolicyTagPolicyCreateRequest } from "./MonitorConfigPolicy import { MonitorDowntimeMatchResponse } from "./MonitorDowntimeMatchResponse"; import { MonitorDowntimeMatchResponseAttributes } from "./MonitorDowntimeMatchResponseAttributes"; import { MonitorDowntimeMatchResponseData } from "./MonitorDowntimeMatchResponseData"; +import { MonitorNotificationRuleAttributes } from "./MonitorNotificationRuleAttributes"; +import { MonitorNotificationRuleCreateRequest } from "./MonitorNotificationRuleCreateRequest"; +import { MonitorNotificationRuleCreateRequestData } from "./MonitorNotificationRuleCreateRequestData"; +import { MonitorNotificationRuleData } from "./MonitorNotificationRuleData"; +import { MonitorNotificationRuleFilterTags } from "./MonitorNotificationRuleFilterTags"; +import { MonitorNotificationRuleListResponse } from "./MonitorNotificationRuleListResponse"; +import { MonitorNotificationRuleRelationships } from "./MonitorNotificationRuleRelationships"; +import { MonitorNotificationRuleRelationshipsCreatedBy } from "./MonitorNotificationRuleRelationshipsCreatedBy"; +import { MonitorNotificationRuleRelationshipsCreatedByData } from "./MonitorNotificationRuleRelationshipsCreatedByData"; +import { MonitorNotificationRuleResponse } from "./MonitorNotificationRuleResponse"; +import { MonitorNotificationRuleResponseAttributes } from "./MonitorNotificationRuleResponseAttributes"; +import { MonitorNotificationRuleUpdateRequest } from "./MonitorNotificationRuleUpdateRequest"; +import { MonitorNotificationRuleUpdateRequestData } from "./MonitorNotificationRuleUpdateRequestData"; import { MonitorTrigger } from "./MonitorTrigger"; import { MonitorTriggerWrapper } from "./MonitorTriggerWrapper"; import { MonitorType } from "./MonitorType"; @@ -2263,6 +2276,7 @@ const enumsMap: { [key: string]: any[] } = { MonitorConfigPolicyResourceType: ["monitor-config-policy"], MonitorConfigPolicyType: ["tag"], MonitorDowntimeMatchResourceType: ["downtime_match"], + MonitorNotificationRuleResourceType: ["monitor-notification-rule"], NotificationRulesType: ["notification_rules"], ObservabilityPipelineAddFieldsProcessorType: ["add_fields"], ObservabilityPipelineDatadogAgentSourceType: ["datadog_agent"], @@ -3920,6 +3934,24 @@ const typeMap: { [index: string]: any } = { MonitorDowntimeMatchResponseAttributes: MonitorDowntimeMatchResponseAttributes, MonitorDowntimeMatchResponseData: MonitorDowntimeMatchResponseData, + MonitorNotificationRuleAttributes: MonitorNotificationRuleAttributes, + MonitorNotificationRuleCreateRequest: MonitorNotificationRuleCreateRequest, + MonitorNotificationRuleCreateRequestData: + MonitorNotificationRuleCreateRequestData, + MonitorNotificationRuleData: MonitorNotificationRuleData, + MonitorNotificationRuleFilterTags: MonitorNotificationRuleFilterTags, + MonitorNotificationRuleListResponse: MonitorNotificationRuleListResponse, + MonitorNotificationRuleRelationships: MonitorNotificationRuleRelationships, + MonitorNotificationRuleRelationshipsCreatedBy: + MonitorNotificationRuleRelationshipsCreatedBy, + MonitorNotificationRuleRelationshipsCreatedByData: + MonitorNotificationRuleRelationshipsCreatedByData, + MonitorNotificationRuleResponse: MonitorNotificationRuleResponse, + MonitorNotificationRuleResponseAttributes: + MonitorNotificationRuleResponseAttributes, + MonitorNotificationRuleUpdateRequest: MonitorNotificationRuleUpdateRequest, + MonitorNotificationRuleUpdateRequestData: + MonitorNotificationRuleUpdateRequestData, MonitorTrigger: MonitorTrigger, MonitorTriggerWrapper: MonitorTriggerWrapper, MonitorType: MonitorType, @@ -4900,6 +4932,8 @@ const oneOfMap: { [index: string]: string[] } = { MonitorConfigPolicyPolicyCreateRequest: [ "MonitorConfigPolicyTagPolicyCreateRequest", ], + MonitorNotificationRuleFilter: ["MonitorNotificationRuleFilterTags"], + MonitorNotificationRuleResponseIncludedItem: ["User"], ObservabilityPipelineConfigDestinationItem: [ "ObservabilityPipelineDatadogLogsDestination", ],