From 8e0b0e911f441232181f7b7d10b955d80063c773 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 24 Jun 2025 13:19:57 +0000 Subject: [PATCH] Regenerate client from commit 8772660e of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 567 ++++++++++++++++++ ...policy-returns-Bad-Request-response.frozen | 2 +- ...on-policy-returns-Bad-Request-response.yml | 2 +- ...guration-policy-returns-OK-response.frozen | 2 +- ...nfiguration-policy-returns-OK-response.yml | 10 +- ...n-rule-returns-Bad-Request-response.frozen | 2 +- ...tion-rule-returns-Bad-Request-response.yml | 4 +- ...tification-rule-returns-OK-response.frozen | 2 +- ...-notification-rule-returns-OK-response.yml | 12 +- ...mplate-returns-Bad-Request-response.frozen | 1 + ...-template-returns-Bad-Request-response.yml | 26 + ...r-user-template-returns-OK-response.frozen | 1 + ...itor-user-template-returns-OK-response.yml | 51 ++ ...policy-returns-Bad-Request-response.frozen | 2 +- ...on-policy-returns-Bad-Request-response.yml | 2 +- ...n-policy-returns-Not-Found-response.frozen | 2 +- ...tion-policy-returns-Not-Found-response.yml | 2 +- ...guration-policy-returns-OK-response.frozen | 2 +- ...nfiguration-policy-returns-OK-response.yml | 14 +- ...ion-rule-returns-Not-Found-response.frozen | 2 +- ...cation-rule-returns-Not-Found-response.yml | 2 +- ...tification-rule-returns-OK-response.frozen | 2 +- ...-notification-rule-returns-OK-response.yml | 16 +- ...template-returns-Not-Found-response.frozen | 1 + ...er-template-returns-Not-Found-response.yml | 20 + ...n-policy-returns-Not-Found-response.frozen | 2 +- ...tion-policy-returns-Not-Found-response.yml | 2 +- ...guration-policy-returns-OK-response.frozen | 2 +- ...nfiguration-policy-returns-OK-response.yml | 18 +- ...turns-Unprocessable-Entity-response.frozen | 2 +- ...-returns-Unprocessable-Entity-response.yml | 16 +- ...n-policy-returns-Not-Found-response.frozen | 2 +- ...tion-policy-returns-Not-Found-response.yml | 2 +- ...guration-policy-returns-OK-response.frozen | 2 +- ...nfiguration-policy-returns-OK-response.yml | 16 +- ...ion-rule-returns-Not-Found-response.frozen | 2 +- ...cation-rule-returns-Not-Found-response.yml | 2 +- ...tification-rule-returns-OK-response.frozen | 2 +- ...-notification-rule-returns-OK-response.yml | 20 +- ...template-returns-Not-Found-response.frozen | 1 + ...er-template-returns-Not-Found-response.yml | 20 + ...r-user-template-returns-OK-response.frozen | 1 + ...itor-user-template-returns-OK-response.yml | 74 +++ ...ration-policies-returns-OK-response.frozen | 2 +- ...iguration-policies-returns-OK-response.yml | 14 +- ...ification-rules-returns-OK-response.frozen | 2 +- ...notification-rules-returns-OK-response.yml | 18 +- ...-user-templates-returns-OK-response.frozen | 1 + ...tor-user-templates-returns-OK-response.yml | 74 +++ ...n-rule-returns-Bad-Request-response.frozen | 2 +- ...tion-rule-returns-Bad-Request-response.yml | 20 +- ...ion-rule-returns-Not-Found-response.frozen | 2 +- ...cation-rule-returns-Not-Found-response.yml | 4 +- ...tification-rule-returns-OK-response.frozen | 2 +- ...-notification-rule-returns-OK-response.yml | 24 +- ...ersion-returns-Bad-Request-response.frozen | 1 + ...w-version-returns-Bad-Request-response.yml | 74 +++ ...-version-returns-Not-Found-response.frozen | 1 + ...new-version-returns-Not-Found-response.yml | 27 + ...o-a-new-version-returns-OK-response.frozen | 1 + ...e-to-a-new-version-returns-OK-response.yml | 90 +++ ...mplate-returns-Bad-Request-response.frozen | 1 + ...-template-returns-Bad-Request-response.yml | 26 + ...r-user-template-returns-OK-response.frozen | 1 + ...itor-user-template-returns-OK-response.yml | 27 + ...mplate-returns-Bad-Request-response.frozen | 1 + ...-template-returns-Bad-Request-response.yml | 75 +++ ...template-returns-Not-Found-response.frozen | 1 + ...er-template-returns-Not-Found-response.yml | 27 + ...r-user-template-returns-OK-response.frozen | 1 + ...itor-user-template-returns-OK-response.yml | 75 +++ .../v2/monitors/CreateMonitorUserTemplate.rb | 37 ++ .../v2/monitors/DeleteMonitorUserTemplate.rb | 8 + .../v2/monitors/GetMonitorUserTemplate.rb | 11 + .../v2/monitors/ListMonitorUserTemplates.rb | 8 + .../v2/monitors/UpdateMonitorUserTemplate.rb | 41 ++ .../ValidateExistingMonitorUserTemplate.rb | 41 ++ .../monitors/ValidateMonitorUserTemplate.rb | 37 ++ features/scenarios_model_mapping.rb | 21 + features/v2/given.json | 12 + features/v2/monitors.feature | 133 ++++ features/v2/undo.json | 49 ++ lib/datadog_api_client/configuration.rb | 7 + lib/datadog_api_client/inflector.rb | 15 + lib/datadog_api_client/v2/api/monitors_api.rb | 512 ++++++++++++++++ .../v2/models/monitor_user_template.rb | 200 ++++++ .../monitor_user_template_create_data.rb | 144 +++++ .../monitor_user_template_create_request.rb | 123 ++++ .../monitor_user_template_create_response.rb | 105 ++++ .../monitor_user_template_list_response.rb | 107 ++++ ...onitor_user_template_request_attributes.rb | 172 ++++++ .../monitor_user_template_resource_type.rb | 26 + .../models/monitor_user_template_response.rb | 105 ++++ ...nitor_user_template_response_attributes.rb | 188 ++++++ .../monitor_user_template_response_data.rb | 125 ++++ ...er_template_response_data_with_versions.rb | 125 ++++ ..._user_template_template_variables_items.rb | 132 ++++ .../monitor_user_template_update_data.rb | 165 +++++ .../monitor_user_template_update_request.rb | 123 ++++ .../v2/models/simple_monitor_user_template.rb | 188 ++++++ 101 files changed, 4362 insertions(+), 135 deletions(-) create mode 100644 cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-OK-response.frozen create mode 100644 cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-OK-response.yml create mode 100644 cassettes/features/v2/monitors/Delete-a-monitor-user-template-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/monitors/Delete-a-monitor-user-template-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-OK-response.frozen create mode 100644 cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-OK-response.yml create mode 100644 cassettes/features/v2/monitors/Get-all-monitor-user-templates-returns-OK-response.frozen create mode 100644 cassettes/features/v2/monitors/Get-all-monitor-user-templates-returns-OK-response.yml create mode 100644 cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-OK-response.frozen create mode 100644 cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-OK-response.yml create mode 100644 cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-OK-response.frozen create mode 100644 cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-OK-response.yml create mode 100644 cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-OK-response.frozen create mode 100644 cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-OK-response.yml create mode 100644 examples/v2/monitors/CreateMonitorUserTemplate.rb create mode 100644 examples/v2/monitors/DeleteMonitorUserTemplate.rb create mode 100644 examples/v2/monitors/GetMonitorUserTemplate.rb create mode 100644 examples/v2/monitors/ListMonitorUserTemplates.rb create mode 100644 examples/v2/monitors/UpdateMonitorUserTemplate.rb create mode 100644 examples/v2/monitors/ValidateExistingMonitorUserTemplate.rb create mode 100644 examples/v2/monitors/ValidateMonitorUserTemplate.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_create_response.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_list_response.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_response.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_response_data_with_versions.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_template_variables_items.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/monitor_user_template_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/simple_monitor_user_template.rb diff --git a/.apigentools-info b/.apigentools-info index 4c6ecf85a0e6..2b7cf451cbff 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-23 20:34:45.845147", - "spec_repo_commit": "837c2656" + "regenerated": "2025-06-24 13:19:23.771976", + "spec_repo_commit": "8772660e" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-23 20:34:45.862297", - "spec_repo_commit": "837c2656" + "regenerated": "2025-06-24 13:19:23.788695", + "spec_repo_commit": "8772660e" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 115918b18dce..6f33dcc74dab 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23664,6 +23664,278 @@ components: description: The monitor type. type: string type: object + MonitorUserTemplate: + additionalProperties: {} + description: A monitor user template object. + properties: + created: + $ref: '#/components/schemas/MonitorUserTemplateCreated' + description: + $ref: '#/components/schemas/MonitorUserTemplateDescription' + modified: + $ref: '#/components/schemas/MonitorUserTemplateModified' + monitor_definition: + additionalProperties: {} + description: A valid monitor definition in the same format as the [V1 Monitor + API](https://docs.datadoghq.com/api/latest/monitors/#create-a-monitor). + example: + message: You may need to add web hosts if this is consistently high. + name: Bytes received on host0 + query: avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100 + type: query alert + type: object + tags: + $ref: '#/components/schemas/MonitorUserTemplateTags' + template_variables: + $ref: '#/components/schemas/MonitorUserTemplateTemplateVariables' + title: + $ref: '#/components/schemas/MonitorUserTemplateTitle' + version: + $ref: '#/components/schemas/MonitorUserTemplateVersion' + versions: + description: All versions of the monitor user template. + items: + $ref: '#/components/schemas/SimpleMonitorUserTemplate' + type: array + type: object + MonitorUserTemplateCreateData: + description: Monitor user template data. + properties: + attributes: + $ref: '#/components/schemas/MonitorUserTemplateRequestAttributes' + type: + $ref: '#/components/schemas/MonitorUserTemplateResourceType' + required: + - type + - attributes + type: object + MonitorUserTemplateCreateRequest: + description: Request for creating a monitor user template. + properties: + data: + $ref: '#/components/schemas/MonitorUserTemplateCreateData' + required: + - data + type: object + MonitorUserTemplateCreateResponse: + description: Response for creating a monitor user template. + properties: + data: + $ref: '#/components/schemas/MonitorUserTemplateResponseData' + type: object + MonitorUserTemplateCreated: + description: The created timestamp of the template. + example: '2024-01-02T03:04:23.274966+00:00' + format: date-time + readOnly: true + type: string + MonitorUserTemplateDescription: + description: A brief description of the monitor user template. + example: This is a template for monitoring user activity. + nullable: true + type: string + MonitorUserTemplateId: + description: The unique identifier. + example: 00000000-0000-1234-0000-000000000000 + type: string + MonitorUserTemplateListResponse: + description: Response for retrieving all monitor user templates. + properties: + data: + description: An array of monitor user templates. + items: + $ref: '#/components/schemas/MonitorUserTemplateResponseData' + type: array + type: object + MonitorUserTemplateModified: + description: The last modified timestamp. When the template version was created. + example: '2024-02-02T03:04:23.274966+00:00' + format: date-time + readOnly: true + type: string + MonitorUserTemplateRequestAttributes: + additionalProperties: false + description: Attributes for a monitor user template. + properties: + description: + $ref: '#/components/schemas/MonitorUserTemplateDescription' + monitor_definition: + additionalProperties: {} + description: A valid monitor definition in the same format as the [V1 Monitor + API](https://docs.datadoghq.com/api/latest/monitors/#create-a-monitor). + example: + message: You may need to add web hosts if this is consistently high. + name: Bytes received on host0 + query: avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100 + type: query alert + type: object + tags: + $ref: '#/components/schemas/MonitorUserTemplateTags' + template_variables: + $ref: '#/components/schemas/MonitorUserTemplateTemplateVariables' + title: + $ref: '#/components/schemas/MonitorUserTemplateTitle' + required: + - title + - monitor_definition + - tags + type: object + MonitorUserTemplateResourceType: + default: monitor-user-template + description: Monitor user template resource type. + enum: + - monitor-user-template + example: monitor-user-template + type: string + x-enum-varnames: + - MONITOR_USER_TEMPLATE + MonitorUserTemplateResponse: + description: Response for retrieving a monitor user template. + properties: + data: + $ref: '#/components/schemas/MonitorUserTemplateResponseDataWithVersions' + type: object + MonitorUserTemplateResponseAttributes: + additionalProperties: {} + description: Attributes for a monitor user template. + properties: + created: + $ref: '#/components/schemas/MonitorUserTemplateCreated' + description: + $ref: '#/components/schemas/MonitorUserTemplateDescription' + modified: + $ref: '#/components/schemas/MonitorUserTemplateModified' + monitor_definition: + additionalProperties: {} + description: A valid monitor definition in the same format as the [V1 Monitor + API](https://docs.datadoghq.com/api/latest/monitors/#create-a-monitor). + example: + message: You may need to add web hosts if this is consistently high. + name: Bytes received on host0 + query: avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100 + type: query alert + type: object + tags: + $ref: '#/components/schemas/MonitorUserTemplateTags' + template_variables: + $ref: '#/components/schemas/MonitorUserTemplateTemplateVariables' + title: + $ref: '#/components/schemas/MonitorUserTemplateTitle' + version: + $ref: '#/components/schemas/MonitorUserTemplateVersion' + type: object + MonitorUserTemplateResponseData: + description: Monitor user template list response data. + properties: + attributes: + $ref: '#/components/schemas/MonitorUserTemplateResponseAttributes' + id: + $ref: '#/components/schemas/MonitorUserTemplateId' + type: + $ref: '#/components/schemas/MonitorUserTemplateResourceType' + type: object + MonitorUserTemplateResponseDataWithVersions: + description: Monitor user template data. + properties: + attributes: + $ref: '#/components/schemas/MonitorUserTemplate' + id: + $ref: '#/components/schemas/MonitorUserTemplateId' + type: + $ref: '#/components/schemas/MonitorUserTemplateResourceType' + type: object + MonitorUserTemplateTags: + description: The definition of `MonitorUserTemplateTags` object. + example: + - product:Our Custom App + - integration:Azure + items: + description: 'Tags associated with the monitor user template. Must be key + value. Only ''product'' and ''integration'' keys are + + allowed. The value is the name of the category to display the template under. + Integrations can be filtered out in the UI. + + (Review note: This modeling of ''categories'' is subject to change.)' + example: us-east1 + minLength: 1 + type: string + uniqueItems: true + type: array + MonitorUserTemplateTemplateVariables: + description: The definition of `MonitorUserTemplateTemplateVariables` object. + items: + $ref: '#/components/schemas/MonitorUserTemplateTemplateVariablesItems' + type: array + MonitorUserTemplateTemplateVariablesItems: + additionalProperties: false + description: List of objects representing template variables on the monitor + which can have selectable values. + properties: + available_values: + description: Available values for the variable. + example: + - value1 + - value2 + items: + minLength: 1 + type: string + uniqueItems: true + type: array + defaults: + description: Default values of the template variable. + example: + - defaultValue + items: + minLength: 0 + type: string + uniqueItems: true + type: array + name: + description: The name of the template variable. + example: regionName + type: string + tag_key: + description: The tag key associated with the variable. This works the same + as dashboard template variables. + example: datacenter + type: string + required: + - name + type: object + MonitorUserTemplateTitle: + description: The title of the monitor user template. + example: Postgres CPU Monitor + type: string + MonitorUserTemplateUpdateData: + description: Monitor user template data. + properties: + attributes: + $ref: '#/components/schemas/MonitorUserTemplateRequestAttributes' + id: + $ref: '#/components/schemas/MonitorUserTemplateId' + type: + $ref: '#/components/schemas/MonitorUserTemplateResourceType' + required: + - id + - type + - attributes + type: object + MonitorUserTemplateUpdateRequest: + description: Request for creating a new monitor user template version. + properties: + data: + $ref: '#/components/schemas/MonitorUserTemplateUpdateData' + required: + - data + type: object + MonitorUserTemplateVersion: + description: The version of the monitor user template. + example: 0 + format: int64 + nullable: true + readOnly: true + type: integer MonthlyCostAttributionAttributes: description: Cost Attribution by Tag for a given organization. properties: @@ -36839,6 +37111,37 @@ components: description: The definition of `ShiftIncluded` object. oneOf: - $ref: '#/components/schemas/ScheduleUser' + SimpleMonitorUserTemplate: + description: A simplified version of a monitor user template. + properties: + created: + $ref: '#/components/schemas/MonitorUserTemplateCreated' + description: + $ref: '#/components/schemas/MonitorUserTemplateDescription' + id: + description: The unique identifier. The initial version will match the template + ID. + example: 00000000-0000-1234-0000-000000000000 + type: string + monitor_definition: + additionalProperties: {} + description: A valid monitor definition in the same format as the [V1 Monitor + API](https://docs.datadoghq.com/api/latest/monitors/#create-a-monitor). + example: + message: You may need to add web hosts if this is consistently high. + name: Bytes received on host0 + query: avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100 + type: query alert + type: object + tags: + $ref: '#/components/schemas/MonitorUserTemplateTags' + template_variables: + $ref: '#/components/schemas/MonitorUserTemplateTemplateVariables' + title: + $ref: '#/components/schemas/MonitorUserTemplateTitle' + version: + $ref: '#/components/schemas/MonitorUserTemplateVersion' + type: object SingleAggregatedConnectionResponseArray: description: List of aggregated connections. example: @@ -52384,6 +52687,270 @@ paths: operator: OR permissions: - monitor_config_policy_write + /api/v2/monitor/template: + get: + description: Retrieve all monitor user templates. + operationId: ListMonitorUserTemplates + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorUserTemplateListResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - monitors_read + summary: Get all monitor user templates + tags: + - Monitors + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new monitor user template. + operationId: CreateMonitorUserTemplate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorUserTemplateCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorUserTemplateCreateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - monitor_config_policy_write + summary: Create a monitor user template + tags: + - Monitors + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/monitor/template/validate: + post: + description: Validate the structure and content of a monitor user template. + operationId: ValidateMonitorUserTemplate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorUserTemplateCreateRequest' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - monitor_config_policy_write + summary: Validate a monitor user template + tags: + - Monitors + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/monitor/template/{template_id}: + delete: + description: Delete an existing monitor user template by its ID. + operationId: DeleteMonitorUserTemplate + parameters: + - description: ID of the monitor user template. + in: path + name: template_id + required: true + schema: + type: string + responses: + '204': + description: OK + '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 user template + tags: + - Monitors + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Retrieve a monitor user template by its ID. + operationId: GetMonitorUserTemplate + parameters: + - description: ID of the monitor user template. + in: path + name: template_id + required: true + schema: + example: 00000000-0000-1234-0000-000000000000 + type: string + - description: Whether to include all versions of the template in the response + in the versions field. + example: false + in: query + name: with_all_versions + required: false + schema: + type: boolean + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorUserTemplateResponse' + description: OK + '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 user template + tags: + - Monitors + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Creates a new version of an existing monitor user template. + operationId: UpdateMonitorUserTemplate + parameters: + - description: ID of the monitor user template. + in: path + name: template_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorUserTemplateUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorUserTemplateResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '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 user template to a new version + tags: + - Monitors + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/monitor/template/{template_id}/validate: + post: + description: Validate the structure and content of an existing monitor user + template being updated to a new version. + operationId: ValidateExistingMonitorUserTemplate + parameters: + - description: ID of the monitor user template. + in: path + name: template_id + required: true + schema: + example: 00000000-0000-1234-0000-000000000000 + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MonitorUserTemplateUpdateRequest' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '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: Validate an existing monitor user template + tags: + - Monitors + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/monitor/{monitor_id}/downtime_matches: get: description: Get all active downtimes for the specified monitor. diff --git a/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-Bad-Request-response.frozen b/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-Bad-Request-response.frozen index f465efe8f03f..4066503df4b4 100644 --- a/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-Bad-Request-response.frozen @@ -1 +1 @@ -2023-04-27T20:34:58.955Z \ No newline at end of file +2025-05-29T02:36:15.011Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-Bad-Request-response.yml b/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-Bad-Request-response.yml index 3b1c08d65af6..356291f3d31c 100644 --- a/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-Bad-Request-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:34:58 GMT +- recorded_at: Thu, 29 May 2025 02:36:15 GMT request: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-OK-response.frozen b/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-OK-response.frozen index 83a11894fbd4..fcae6e77ede6 100644 --- a/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-OK-response.frozen @@ -1 +1 @@ -2023-04-27T20:34:59.311Z \ No newline at end of file +2025-05-29T02:36:15.129Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-OK-response.yml b/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-OK-response.yml index c9ec8a14220f..a7892d052e9e 100644 --- a/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Create-a-monitor-configuration-policy-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:34:59 GMT +- recorded_at: Thu, 29 May 2025 02:36:15 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"policy":{"tag_key":"testcreateamonitorconfigurationpolicyreturnsokresponse1682627699","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' + string: '{"data":{"attributes":{"policy":{"tag_key":"testcreateamonitorconfigurationpolicyreturnsokresponse1748486175","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' headers: Accept: - application/json @@ -14,7 +14,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"monitor-config-policy","id":"fabd0b6e-e53a-11ed-a07b-da7ad0900002","attributes":{"policy":{"valid_tag_values":["prod","staging"],"tag_key_required":false,"tag_key":"testcreateamonitorconfigurationpolicyreturnsokresponse1682627699"},"policy_type":"tag"}}} + string: '{"data":{"type":"monitor-config-policy","attributes":{"policy_type":"tag","policy":{"tag_key_required":false,"valid_tag_values":["prod","staging"],"tag_key":"testcreateamonitorconfigurationpolicyreturnsokresponse1748486175"}},"id":"edb99130-4a6a-4970-b6df-83b5cba1182a"}} ' headers: @@ -23,14 +23,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:34:59 GMT +- recorded_at: Thu, 29 May 2025 02:36:15 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/policy/fabd0b6e-e53a-11ed-a07b-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/edb99130-4a6a-4970-b6df-83b5cba1182a response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-Bad-Request-response.frozen index 454c4bb29a36..a29e72739ccf 100644 --- a/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-Bad-Request-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:43.940Z \ No newline at end of file +2025-05-29T02:36:15.400Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-Bad-Request-response.yml index a51c9490b51b..975b35a5c9c2 100644 --- a/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-Bad-Request-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:43 GMT +- recorded_at: Thu, 29 May 2025 02:36:15 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"filter":{"tags":["test:test-create_a_monitor_notification_rule_returns_bad_request_response-1744280983","host:abc"]},"name":"test + string: '{"data":{"attributes":{"filter":{"tags":["test:test-create_a_monitor_notification_rule_returns_bad_request_response-1748486175","host:abc"]},"name":"test rule","recipients":["@slack-test-channel","@jira-test"]},"type":"monitor-notification-rule"}}' headers: Accept: diff --git a/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-OK-response.frozen b/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-OK-response.frozen index 86ab3de39bc5..f7e7180ce180 100644 --- a/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-OK-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:44.273Z \ No newline at end of file +2025-05-29T02:36:15.486Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-OK-response.yml b/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-OK-response.yml index 179b174264fb..43af0dd486ce 100644 --- a/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Create-a-monitor-notification-rule-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:44 GMT +- recorded_at: Thu, 29 May 2025 02:36:15 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"filter":{"tags":["test:test-create_a_monitor_notification_rule_returns_ok_response-1744280984"]},"name":"test + string: '{"data":{"attributes":{"filter":{"tags":["test:test-create_a_monitor_notification_rule_returns_ok_response-1748486175"]},"name":"test rule","recipients":["slack-test-channel","jira-test"]},"type":"monitor-notification-rule"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}}]} + string: '{"data":{"type":"monitor-notification-rule","attributes":{"created_at":"2025-05-29T02:36:15.639714+00:00","filter":{"tags":["test:test-create_a_monitor_notification_rule_returns_ok_response-1748486175"]},"recipients":["slack-test-channel","jira-test"],"modified_at":"1970-01-01T00:00:00+00:00","name":"test + rule"},"relationships":{"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}},"id":"5dca07c7-267c-4159-9d8f-7dec1512fb77"},"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-05-06T01:37:11.870914+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"}}]} ' headers: @@ -25,14 +25,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:44 GMT +- recorded_at: Thu, 29 May 2025 02:36:15 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/a3323ef6-2a04-4ef9-8de8-cbcff5c3c203 + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/5dca07c7-267c-4159-9d8f-7dec1512fb77 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-Bad-Request-response.frozen b/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..99f122840a73 --- /dev/null +++ b/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:15.918Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-Bad-Request-response.yml b/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..373bfdddb544 --- /dev/null +++ b/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-Bad-Request-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:15 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-create_a_monitor_user_template_returns_bad_request_response-1748486175"},"type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"errors":["Invalid monitor_definition or template variables: Monitor + definition cannot be empty."]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-OK-response.frozen b/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-OK-response.frozen new file mode 100644 index 000000000000..d617ccf69f05 --- /dev/null +++ b/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:16.048Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-OK-response.yml b/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-OK-response.yml new file mode 100644 index 000000000000..80f9a435701a --- /dev/null +++ b/cassettes/features/v2/monitors/Create-a-monitor-user-template-returns-OK-response.yml @@ -0,0 +1,51 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:16 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{"message":"A + msg.","name":"A name test-create_a_monitor_user_template_returns_ok_response-1748486176","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-create_a_monitor_user_template_returns_ok_response-1748486176"},"type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"modified":"2025-05-29T02:36:16.272266+00:00","tags":["integration:Azure"],"monitor_definition":{"message":"A + msg.","name":"A name test-create_a_monitor_user_template_returns_ok_response-1748486176","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"tag_key":"datacenter","name":"regionName"}],"description":"A + description.","version":0,"creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","created":"2025-05-29T02:36:16.272266+00:00","title":"Postgres + DB test-create_a_monitor_user_template_returns_ok_response-1748486176"},"id":"15c66feb-f77d-407b-bf4c-615d3dc4fa50"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:16 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/monitor/template/15c66feb-f77d-407b-bf4c-615d3dc4fa50 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Bad-Request-response.frozen b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Bad-Request-response.frozen index 94a2d0766cc4..1010ce4749f0 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Bad-Request-response.frozen @@ -1 +1 @@ -2023-04-27T20:34:59.820Z \ No newline at end of file +2025-05-29T02:36:16.452Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Bad-Request-response.yml b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Bad-Request-response.yml index 9a546a520605..115ae9900bbb 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Bad-Request-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:34:59 GMT +- recorded_at: Thu, 29 May 2025 02:36:16 GMT request: body: null headers: diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Not-Found-response.frozen index 844a6642df20..7ae4617a1d15 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Not-Found-response.frozen @@ -1 +1 @@ -2023-04-27T20:35:00.006Z \ No newline at end of file +2025-05-29T02:36:16.549Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Not-Found-response.yml index 8083a422cd96..a7327cae6c93 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Not-Found-response.yml +++ b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-Not-Found-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:35:00 GMT +- recorded_at: Thu, 29 May 2025 02:36:16 GMT request: body: null headers: diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-OK-response.frozen b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-OK-response.frozen index b0d9464efa88..284f2e61ee0c 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-OK-response.frozen @@ -1 +1 @@ -2023-04-27T20:35:00.311Z \ No newline at end of file +2025-05-29T02:36:16.671Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-OK-response.yml b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-OK-response.yml index f09f6328ea88..3041500c5e62 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Delete-a-monitor-configuration-policy-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:35:00 GMT +- recorded_at: Thu, 29 May 2025 02:36:16 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"policy":{"tag_key":"testdeleteamonitorconfigurationpolicyreturnsokresponse1682627700","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' + string: '{"data":{"attributes":{"policy":{"tag_key":"testdeleteamonitorconfigurationpolicyreturnsokresponse1748486176","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' headers: Accept: - application/json @@ -14,7 +14,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"monitor-config-policy","attributes":{"policy_type":"tag","policy":{"tag_key_required":false,"tag_key":"testdeleteamonitorconfigurationpolicyreturnsokresponse1682627700","valid_tag_values":["prod","staging"]}},"id":"fb4a2490-e53a-11ed-a5db-da7ad0900002"}} + string: '{"data":{"type":"monitor-config-policy","attributes":{"policy_type":"tag","policy":{"tag_key":"testdeleteamonitorconfigurationpolicyreturnsokresponse1748486176","valid_tag_values":["prod","staging"],"tag_key_required":false}},"id":"f0b1ee92-9635-45ed-8a18-a1631a8397d2"}} ' headers: @@ -23,14 +23,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:35:00 GMT +- recorded_at: Thu, 29 May 2025 02:36:16 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/policy/fb4a2490-e53a-11ed-a5db-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/f0b1ee92-9635-45ed-8a18-a1631a8397d2 response: body: encoding: UTF-8 @@ -41,14 +41,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 27 Apr 2023 20:35:00 GMT +- recorded_at: Thu, 29 May 2025 02:36:16 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/policy/fb4a2490-e53a-11ed-a5db-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/f0b1ee92-9635-45ed-8a18-a1631a8397d2 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-Not-Found-response.frozen index 2590d462ecda..57a7f6d2e7eb 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-Not-Found-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:46.694Z \ No newline at end of file +2025-05-29T02:36:17.047Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-Not-Found-response.yml index da33edcd8107..cf8cb5e2cc1b 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-Not-Found-response.yml +++ b/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-Not-Found-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:46 GMT +- recorded_at: Thu, 29 May 2025 02:36:17 GMT request: body: null headers: diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-OK-response.frozen b/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-OK-response.frozen index c1dc706f2cb1..23f9fba845cc 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-OK-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:47.053Z \ No newline at end of file +2025-05-29T02:36:17.179Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-OK-response.yml b/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-OK-response.yml index 50faee5387a1..30acb8a20bee 100644 --- a/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Delete-a-monitor-notification-rule-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:47 GMT +- recorded_at: Thu, 29 May 2025 02:36:17 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"filter":{"tags":["app:test-delete_a_monitor_notification_rule_returns_ok_response-1744280987"]},"name":"test + string: '{"data":{"attributes":{"filter":{"tags":["app:test-delete_a_monitor_notification_rule_returns_ok_response-1748486177"]},"name":"test rule","recipients":["slack-monitor-app"]},"type":"monitor-notification-rule"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}}]} + string: '{"data":{"type":"monitor-notification-rule","attributes":{"created_at":"2025-05-29T02:36:17.310680+00:00","filter":{"tags":["app:test-delete_a_monitor_notification_rule_returns_ok_response-1748486177"]},"modified_at":"1970-01-01T00:00:00+00:00","recipients":["slack-monitor-app"],"name":"test + rule"},"relationships":{"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}},"id":"ae73c449-eadb-40ce-9eb3-9d56d8216254"},"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-05-06T01:37:11.870914+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"}}]} ' headers: @@ -25,14 +25,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:47 GMT +- recorded_at: Thu, 29 May 2025 02:36:17 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/66e399af-c07e-414d-b4f2-93e196d7b7b7 + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/ae73c449-eadb-40ce-9eb3-9d56d8216254 response: body: encoding: UTF-8 @@ -43,14 +43,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 10 Apr 2025 10:29:47 GMT +- recorded_at: Thu, 29 May 2025 02:36:17 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/66e399af-c07e-414d-b4f2-93e196d7b7b7 + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/ae73c449-eadb-40ce-9eb3-9d56d8216254 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-user-template-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Delete-a-monitor-user-template-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..5e8ee5338f65 --- /dev/null +++ b/cassettes/features/v2/monitors/Delete-a-monitor-user-template-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:17.713Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Delete-a-monitor-user-template-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Delete-a-monitor-user-template-returns-Not-Found-response.yml new file mode 100644 index 000000000000..99d0bd94f520 --- /dev/null +++ b/cassettes/features/v2/monitors/Delete-a-monitor-user-template-returns-Not-Found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/monitor/template/00000000-0000-1234-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":["Monitor template not found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Not-Found-response.frozen index cf29ebf6e089..bee5a97d5c4f 100644 --- a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Not-Found-response.frozen @@ -1 +1 @@ -2023-04-27T20:35:01.028Z \ No newline at end of file +2025-05-29T02:36:17.896Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Not-Found-response.yml index 88a03867c7dc..1449e0c02174 100644 --- a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Not-Found-response.yml +++ b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Not-Found-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:35:01 GMT +- recorded_at: Thu, 29 May 2025 02:36:17 GMT request: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-OK-response.frozen b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-OK-response.frozen index 054169c07339..2b9bd5902e82 100644 --- a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-OK-response.frozen @@ -1 +1 @@ -2023-04-27T20:35:01.273Z \ No newline at end of file +2025-05-29T02:36:18.010Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-OK-response.yml b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-OK-response.yml index f57ad3effb3c..d5f557bd6e1a 100644 --- a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:35:01 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsokresponse1682627701","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' + string: '{"data":{"attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsokresponse1748486178","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' headers: Accept: - application/json @@ -14,7 +14,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"monitor-config-policy","id":"fbdb67de-e53a-11ed-9e4a-da7ad0900002","attributes":{"policy":{"valid_tag_values":["prod","staging"],"tag_key_required":false,"tag_key":"testeditamonitorconfigurationpolicyreturnsokresponse1682627701"},"policy_type":"tag"}}} + string: '{"data":{"type":"monitor-config-policy","attributes":{"policy":{"valid_tag_values":["prod","staging"],"tag_key":"testeditamonitorconfigurationpolicyreturnsokresponse1748486178","tag_key_required":false},"policy_type":"tag"},"id":"b967c47e-8f9b-49f5-bdff-744b4d50b26f"}} ' headers: @@ -23,22 +23,22 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:35:01 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsokresponse1682627701","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"id":"fbdb67de-e53a-11ed-9e4a-da7ad0900002","type":"monitor-config-policy"}}' + string: '{"data":{"attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsokresponse1748486178","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"id":"b967c47e-8f9b-49f5-bdff-744b4d50b26f","type":"monitor-config-policy"}}' headers: Accept: - application/json Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/monitor/policy/fbdb67de-e53a-11ed-9e4a-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/b967c47e-8f9b-49f5-bdff-744b4d50b26f response: body: encoding: UTF-8 - string: '{"data":{"type":"monitor-config-policy","attributes":{"policy_type":"tag","policy":{"valid_tag_values":["prod","staging"],"tag_key":"testeditamonitorconfigurationpolicyreturnsokresponse1682627701","tag_key_required":false}},"id":"fbdb67de-e53a-11ed-9e4a-da7ad0900002"}} + string: '{"data":{"type":"monitor-config-policy","attributes":{"policy_type":"tag","policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsokresponse1748486178","valid_tag_values":["prod","staging"],"tag_key_required":false}},"id":"b967c47e-8f9b-49f5-bdff-744b4d50b26f"}} ' headers: @@ -47,14 +47,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:35:01 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/policy/fbdb67de-e53a-11ed-9e4a-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/b967c47e-8f9b-49f5-bdff-744b4d50b26f response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Unprocessable-Entity-response.frozen b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Unprocessable-Entity-response.frozen index da44ed34e7af..0c25447bf3ae 100644 --- a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Unprocessable-Entity-response.frozen +++ b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Unprocessable-Entity-response.frozen @@ -1 +1 @@ -2023-04-27T20:35:01.901Z \ No newline at end of file +2025-05-29T02:36:18.429Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Unprocessable-Entity-response.yml b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Unprocessable-Entity-response.yml index a6ca49feb81b..d3cb9f0f3a60 100644 --- a/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Unprocessable-Entity-response.yml +++ b/cassettes/features/v2/monitors/Edit-a-monitor-configuration-policy-returns-Unprocessable-Entity-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:35:01 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsunprocessableentityresponse1682627701","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' + string: '{"data":{"attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsunprocessableentityresponse1748486178","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' headers: Accept: - application/json @@ -14,7 +14,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"monitor-config-policy","attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsunprocessableentityresponse1682627701","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"id":"fc38f7f0-e53a-11ed-947f-da7ad0900002"}} + string: '{"data":{"type":"monitor-config-policy","attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsunprocessableentityresponse1748486178","valid_tag_values":["prod","staging"],"tag_key_required":false},"policy_type":"tag"},"id":"f2f83512-b2c2-4dc4-a8db-c785cd818d6f"}} ' headers: @@ -23,18 +23,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:35:01 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsunprocessableentityresponse1682627701","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-config-policy"}}' + string: '{"data":{"attributes":{"policy":{"tag_key":"testeditamonitorconfigurationpolicyreturnsunprocessableentityresponse1748486178","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-config-policy"}}' headers: Accept: - application/json Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/monitor/policy/fc38f7f0-e53a-11ed-947f-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/f2f83512-b2c2-4dc4-a8db-c785cd818d6f response: body: encoding: UTF-8 @@ -45,14 +45,14 @@ http_interactions: status: code: 422 message: Unprocessable Entity -- recorded_at: Thu, 27 Apr 2023 20:35:01 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/policy/fc38f7f0-e53a-11ed-947f-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/f2f83512-b2c2-4dc4-a8db-c785cd818d6f response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-Not-Found-response.frozen index 4fab297722f9..4cc7aa02cc44 100644 --- a/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-Not-Found-response.frozen @@ -1 +1 @@ -2023-04-27T20:35:02.620Z \ No newline at end of file +2025-05-29T02:36:18.835Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-Not-Found-response.yml index 038a93d88d4b..f021090e2864 100644 --- a/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-Not-Found-response.yml +++ b/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-Not-Found-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:35:02 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: null headers: diff --git a/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-OK-response.frozen b/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-OK-response.frozen index d650deaf5941..c4817e4665ae 100644 --- a/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-OK-response.frozen @@ -1 +1 @@ -2023-04-27T20:35:02.925Z \ No newline at end of file +2025-05-29T02:36:18.939Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-OK-response.yml b/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-OK-response.yml index 5b9c86cd4d15..abe85a3e921d 100644 --- a/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Get-a-monitor-configuration-policy-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:35:02 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"policy":{"tag_key":"testgetamonitorconfigurationpolicyreturnsokresponse1682627702","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' + string: '{"data":{"attributes":{"policy":{"tag_key":"testgetamonitorconfigurationpolicyreturnsokresponse1748486178","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' headers: Accept: - application/json @@ -14,7 +14,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"monitor-config-policy","attributes":{"policy_type":"tag","policy":{"tag_key":"testgetamonitorconfigurationpolicyreturnsokresponse1682627702","valid_tag_values":["prod","staging"],"tag_key_required":false}},"id":"fcd6f8ec-e53a-11ed-8b5f-da7ad0900002"}} + string: '{"data":{"type":"monitor-config-policy","attributes":{"policy":{"valid_tag_values":["prod","staging"],"tag_key_required":false,"tag_key":"testgetamonitorconfigurationpolicyreturnsokresponse1748486178"},"policy_type":"tag"},"id":"7916e37f-b0fe-4f9d-bf9e-37ee3e7a5460"}} ' headers: @@ -23,18 +23,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:35:02 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/monitor/policy/fcd6f8ec-e53a-11ed-8b5f-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/7916e37f-b0fe-4f9d-bf9e-37ee3e7a5460 response: body: encoding: UTF-8 - string: '{"data":{"type":"monitor-config-policy","attributes":{"policy_type":"tag","policy":{"tag_key_required":false,"tag_key":"testgetamonitorconfigurationpolicyreturnsokresponse1682627702","valid_tag_values":["prod","staging"]}},"id":"fcd6f8ec-e53a-11ed-8b5f-da7ad0900002"}} + string: '{"data":{"type":"monitor-config-policy","attributes":{"policy_type":"tag","policy":{"tag_key_required":false,"tag_key":"testgetamonitorconfigurationpolicyreturnsokresponse1748486178","valid_tag_values":["prod","staging"]}},"id":"7916e37f-b0fe-4f9d-bf9e-37ee3e7a5460"}} ' headers: @@ -43,14 +43,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:35:02 GMT +- recorded_at: Thu, 29 May 2025 02:36:18 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/policy/fcd6f8ec-e53a-11ed-8b5f-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/7916e37f-b0fe-4f9d-bf9e-37ee3e7a5460 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-Not-Found-response.frozen index 4d52b4ac383e..6648dee66af1 100644 --- a/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-Not-Found-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:52.213Z \ No newline at end of file +2025-05-29T02:36:19.291Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-Not-Found-response.yml index e2760e9e5edd..bcb97c701129 100644 --- a/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-Not-Found-response.yml +++ b/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-Not-Found-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:52 GMT +- recorded_at: Thu, 29 May 2025 02:36:19 GMT request: body: null headers: diff --git a/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-OK-response.frozen b/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-OK-response.frozen index 23fa2591c917..0234c33b29ec 100644 --- a/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-OK-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:52.537Z \ No newline at end of file +2025-05-29T02:36:19.434Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-OK-response.yml b/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-OK-response.yml index d20de2c26816..86038a47b959 100644 --- a/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Get-a-monitor-notification-rule-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:52 GMT +- recorded_at: Thu, 29 May 2025 02:36:19 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"filter":{"tags":["app:test-get_a_monitor_notification_rule_returns_ok_response-1744280992"]},"name":"test + string: '{"data":{"attributes":{"filter":{"tags":["app:test-get_a_monitor_notification_rule_returns_ok_response-1748486179"]},"name":"test rule","recipients":["slack-monitor-app"]},"type":"monitor-notification-rule"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}}]} + string: '{"data":{"type":"monitor-notification-rule","id":"78f7ac92-7bba-4f1f-838f-a6fdc2a08778","attributes":{"created_at":"2025-05-29T02:36:19.570654+00:00","name":"test + rule","filter":{"tags":["app:test-get_a_monitor_notification_rule_returns_ok_response-1748486179"]},"recipients":["slack-monitor-app"],"modified_at":"1970-01-01T00:00:00+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-05-06T01:37:11.870914+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"}}]} ' headers: @@ -25,19 +25,19 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:52 GMT +- recorded_at: Thu, 29 May 2025 02:36:19 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/97afb4ac-6953-445f-9a0a-d225673449a6 + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/78f7ac92-7bba-4f1f-838f-a6fdc2a08778 response: body: encoding: UTF-8 - string: '{"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"}} + string: '{"data":{"type":"monitor-notification-rule","attributes":{"modified_at":"2025-05-29T02:36:19.582092+00:00","created_at":"2025-05-29T02:36:19.570655+00:00","recipients":["slack-monitor-app"],"filter":{"tags":["app:test-get_a_monitor_notification_rule_returns_ok_response-1748486179"]},"name":"test + rule"},"id":"78f7ac92-7bba-4f1f-838f-a6fdc2a08778"}} ' headers: @@ -46,14 +46,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:52 GMT +- recorded_at: Thu, 29 May 2025 02:36:19 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/97afb4ac-6953-445f-9a0a-d225673449a6 + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/78f7ac92-7bba-4f1f-838f-a6fdc2a08778 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..958f77273b60 --- /dev/null +++ b/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:19.940Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-Not-Found-response.yml new file mode 100644 index 000000000000..7154e2212bc8 --- /dev/null +++ b/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-Not-Found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:19 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/monitor/template/00000000-0000-1234-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":["Monitor template not found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-OK-response.frozen b/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-OK-response.frozen new file mode 100644 index 000000000000..722dd6639abf --- /dev/null +++ b/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:20.064Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-OK-response.yml b/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-OK-response.yml new file mode 100644 index 000000000000..7b0626028186 --- /dev/null +++ b/cassettes/features/v2/monitors/Get-a-monitor-user-template-returns-OK-response.yml @@ -0,0 +1,74 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"It''s a threshold","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["category:test"],"template_variables":[{"available_values":[],"defaults":["cats"],"name":"scope"}],"title":"api + spec given template test-get_a_monitor_user_template_returns_ok_response-1748486180"},"type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"tags":["category:test"],"created":"2025-05-29T02:36:20.380109+00:00","title":"api + spec given template test-get_a_monitor_user_template_returns_ok_response-1748486180","version":0,"description":"It''s + a threshold","template_variables":[{"defaults":["cats"],"available_values":[],"name":"scope"}],"monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"modified":"2025-05-29T02:36:20.380109+00:00","creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0"},"id":"90eb2b79-fc96-43a5-af65-bf4408f47d9d"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:20 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/monitor/template/90eb2b79-fc96-43a5-af65-bf4408f47d9d + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"created":"2025-05-29T02:36:20.380109+00:00","creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","version":0,"tags":["category:test"],"title":"api + spec given template test-get_a_monitor_user_template_returns_ok_response-1748486180","modified":"2025-05-29T02:36:20.380109+00:00","monitor_definition":{"name":"High + Error Rate on service","type":"query alert","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","message":"cats"},"description":"It''s a threshold","template_variables":[{"defaults":["cats"],"name":"scope","available_values":[]}]},"id":"90eb2b79-fc96-43a5-af65-bf4408f47d9d"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:20 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/monitor/template/90eb2b79-fc96-43a5-af65-bf4408f47d9d + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Get-all-monitor-configuration-policies-returns-OK-response.frozen b/cassettes/features/v2/monitors/Get-all-monitor-configuration-policies-returns-OK-response.frozen index ad2811e9e93b..2e9129e17495 100644 --- a/cassettes/features/v2/monitors/Get-all-monitor-configuration-policies-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Get-all-monitor-configuration-policies-returns-OK-response.frozen @@ -1 +1 @@ -2023-04-27T20:35:03.574Z \ No newline at end of file +2025-05-29T02:36:20.663Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-all-monitor-configuration-policies-returns-OK-response.yml b/cassettes/features/v2/monitors/Get-all-monitor-configuration-policies-returns-OK-response.yml index b8a2fff2a296..e06fe474715d 100644 --- a/cassettes/features/v2/monitors/Get-all-monitor-configuration-policies-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Get-all-monitor-configuration-policies-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 27 Apr 2023 20:35:03 GMT +- recorded_at: Thu, 29 May 2025 02:36:20 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"policy":{"tag_key":"testgetallmonitorconfigurationpoliciesreturnsokresponse1682627703","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' + string: '{"data":{"attributes":{"policy":{"tag_key":"testgetallmonitorconfigurationpoliciesreturnsokresponse1748486180","tag_key_required":false,"valid_tag_values":["prod","staging"]},"policy_type":"tag"},"type":"monitor-config-policy"}}' headers: Accept: - application/json @@ -14,7 +14,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"monitor-config-policy","attributes":{"policy":{"valid_tag_values":["prod","staging"],"tag_key_required":false,"tag_key":"testgetallmonitorconfigurationpoliciesreturnsokresponse1682627703"},"policy_type":"tag"},"id":"fd3bfd14-e53a-11ed-975d-da7ad0900002"}} + string: '{"data":{"type":"monitor-config-policy","attributes":{"policy":{"valid_tag_values":["prod","staging"],"tag_key":"testgetallmonitorconfigurationpoliciesreturnsokresponse1748486180","tag_key_required":false},"policy_type":"tag"},"id":"426917ea-f9b0-4c7d-938d-902208db50f8"}} ' headers: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:35:03 GMT +- recorded_at: Thu, 29 May 2025 02:36:20 GMT request: body: null headers: @@ -34,7 +34,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":[{"type":"monitor-config-policy","id":"fd3bfd14-e53a-11ed-975d-da7ad0900002","attributes":{"policy":{"valid_tag_values":["prod","staging"],"tag_key_required":false,"tag_key":"testgetallmonitorconfigurationpoliciesreturnsokresponse1682627703"},"policy_type":"tag"}}]} + string: '{"data":[{"type":"monitor-config-policy","attributes":{"policy":{"valid_tag_values":["value"],"tag_key":"tagKey","tag_key_required":false},"policy_type":"tag"},"id":"2817dfb9-d616-4a75-8a6b-c34f20493b76"},{"type":"monitor-config-policy","attributes":{"policy":{"valid_tag_values":["prod","staging"],"tag_key":"testgetallmonitorconfigurationpoliciesreturnsokresponse1748486180","tag_key_required":false},"policy_type":"tag"},"id":"426917ea-f9b0-4c7d-938d-902208db50f8"}]} ' headers: @@ -43,14 +43,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 27 Apr 2023 20:35:03 GMT +- recorded_at: Thu, 29 May 2025 02:36:20 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/policy/fd3bfd14-e53a-11ed-975d-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/monitor/policy/426917ea-f9b0-4c7d-938d-902208db50f8 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Get-all-monitor-notification-rules-returns-OK-response.frozen b/cassettes/features/v2/monitors/Get-all-monitor-notification-rules-returns-OK-response.frozen index 2681e3677398..e92416751b54 100644 --- a/cassettes/features/v2/monitors/Get-all-monitor-notification-rules-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Get-all-monitor-notification-rules-returns-OK-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:54.937Z \ No newline at end of file +2025-05-29T02:36:21.000Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-all-monitor-notification-rules-returns-OK-response.yml b/cassettes/features/v2/monitors/Get-all-monitor-notification-rules-returns-OK-response.yml index 49fb1786cff0..080b372eed26 100644 --- a/cassettes/features/v2/monitors/Get-all-monitor-notification-rules-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Get-all-monitor-notification-rules-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:54 GMT +- recorded_at: Thu, 29 May 2025 02:36:21 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"filter":{"tags":["app:test-get_all_monitor_notification_rules_returns_ok_response-1744280994"]},"name":"test + string: '{"data":{"attributes":{"filter":{"tags":["app:test-get_all_monitor_notification_rules_returns_ok_response-1748486181"]},"name":"test rule","recipients":["slack-monitor-app"]},"type":"monitor-notification-rule"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}}]} + string: '{"data":{"type":"monitor-notification-rule","attributes":{"created_at":"2025-05-29T02:36:21.133807+00:00","filter":{"tags":["app:test-get_all_monitor_notification_rules_returns_ok_response-1748486181"]},"modified_at":"1970-01-01T00:00:00+00:00","recipients":["slack-monitor-app"],"name":"test + rule"},"relationships":{"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}},"id":"dbb04d74-98e6-4f3b-905b-f42d7f0cd9e3"},"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-05-06T01:37:11.870914+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"}}]} ' headers: @@ -25,7 +25,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:54 GMT +- recorded_at: Thu, 29 May 2025 02:36:21 GMT request: body: null headers: @@ -36,8 +36,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}]} + string: '{"data":[{"type":"monitor-notification-rule","attributes":{"created_at":"2025-05-29T02:36:21.133807+00:00","filter":{"tags":["app:test-get_all_monitor_notification_rules_returns_ok_response-1748486181"]},"recipients":["slack-monitor-app"],"modified_at":"2025-05-29T02:36:21.141964+00:00","name":"test + rule"},"id":"dbb04d74-98e6-4f3b-905b-f42d7f0cd9e3"}]} ' headers: @@ -46,14 +46,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:54 GMT +- recorded_at: Thu, 29 May 2025 02:36:21 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/b7122864-6517-45d3-8dc1-f226a08dd8f4 + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/dbb04d74-98e6-4f3b-905b-f42d7f0cd9e3 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Get-all-monitor-user-templates-returns-OK-response.frozen b/cassettes/features/v2/monitors/Get-all-monitor-user-templates-returns-OK-response.frozen new file mode 100644 index 000000000000..fd52edc3bced --- /dev/null +++ b/cassettes/features/v2/monitors/Get-all-monitor-user-templates-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:21.470Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Get-all-monitor-user-templates-returns-OK-response.yml b/cassettes/features/v2/monitors/Get-all-monitor-user-templates-returns-OK-response.yml new file mode 100644 index 000000000000..f27f15cd0dba --- /dev/null +++ b/cassettes/features/v2/monitors/Get-all-monitor-user-templates-returns-OK-response.yml @@ -0,0 +1,74 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:21 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"It''s a threshold","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["category:test"],"template_variables":[{"available_values":[],"defaults":["cats"],"name":"scope"}],"title":"api + spec given template test-get_all_monitor_user_templates_returns_ok_response-1748486181"},"type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"description":"It''s + a threshold","created":"2025-05-29T02:36:21.696273+00:00","template_variables":[{"available_values":[],"defaults":["cats"],"name":"scope"}],"creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","version":0,"tags":["category:test"],"modified":"2025-05-29T02:36:21.696273+00:00","title":"api + spec given template test-get_all_monitor_user_templates_returns_ok_response-1748486181","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"}},"id":"900b870a-1f9d-4b6c-95b7-9859bbb0a778"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:21 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"data":[{"type":"monitor-user-template","attributes":{"created":"2025-05-29T02:36:21.696273+00:00","creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","version":0,"tags":["category:test"],"title":"api + spec given template test-get_all_monitor_user_templates_returns_ok_response-1748486181","modified":"2025-05-29T02:36:21.696273+00:00","monitor_definition":{"name":"High + Error Rate on service","type":"query alert","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","message":"cats"},"description":"It''s a threshold","template_variables":[{"defaults":["cats"],"name":"scope","available_values":[]}]},"id":"900b870a-1f9d-4b6c-95b7-9859bbb0a778"}]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:21 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/monitor/template/900b870a-1f9d-4b6c-95b7-9859bbb0a778 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Bad-Request-response.frozen index c547acf2ee0f..5e9f21486df1 100644 --- a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Bad-Request-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:56.210Z \ No newline at end of file +2025-05-29T02:36:21.941Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Bad-Request-response.yml index 259c8a32927c..4efe62a0638e 100644 --- a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Bad-Request-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:56 GMT +- recorded_at: Thu, 29 May 2025 02:36:21 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"filter":{"tags":["app:test-update_a_monitor_notification_rule_returns_bad_request_response-1744280996"]},"name":"test + string: '{"data":{"attributes":{"filter":{"tags":["app:test-update_a_monitor_notification_rule_returns_bad_request_response-1748486181"]},"name":"test rule","recipients":["slack-monitor-app"]},"type":"monitor-notification-rule"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}}]} + string: '{"data":{"type":"monitor-notification-rule","attributes":{"name":"test + rule","created_at":"2025-05-29T02:36:22.099271+00:00","filter":{"tags":["app:test-update_a_monitor_notification_rule_returns_bad_request_response-1748486181"]},"recipients":["slack-monitor-app"],"modified_at":"1970-01-01T00:00:00+00:00"},"relationships":{"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}},"id":"571a01f1-8f6f-4792-9f4a-0aa99f9b2365"},"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-05-06T01:37:11.870914+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"}}]} ' headers: @@ -25,19 +25,19 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:56 GMT +- recorded_at: Thu, 29 May 2025 02:36:21 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"data":{"attributes":{"filter":{"tags":["test:test-update_a_monitor_notification_rule_returns_bad_request_response-1748486181","host:abc"]},"name":"updated + rule","recipients":["@slack-test-channel"]},"id":"571a01f1-8f6f-4792-9f4a-0aa99f9b2365","type":"monitor-notification-rule"}}' headers: Accept: - application/json Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/f26ba0a6-1e84-4984-b061-4172a25a1332 + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/571a01f1-8f6f-4792-9f4a-0aa99f9b2365 response: body: encoding: UTF-8 @@ -49,14 +49,14 @@ http_interactions: status: code: 400 message: Bad Request -- recorded_at: Thu, 10 Apr 2025 10:29:56 GMT +- recorded_at: Thu, 29 May 2025 02:36:21 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/f26ba0a6-1e84-4984-b061-4172a25a1332 + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/571a01f1-8f6f-4792-9f4a-0aa99f9b2365 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Not-Found-response.frozen index 2eae355308b2..37ff149ae902 100644 --- a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Not-Found-response.frozen +++ b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Not-Found-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:57.263Z \ No newline at end of file +2025-05-29T02:36:22.374Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Not-Found-response.yml index c1de57e20f2e..db0a8456c308 100644 --- a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Not-Found-response.yml +++ b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-Not-Found-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:57 GMT +- recorded_at: Thu, 29 May 2025 02:36:22 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"filter":{"tags":["test:test-update_a_monitor_notification_rule_returns_not_found_response-1744280997","host:abc"]},"name":"updated + string: '{"data":{"attributes":{"filter":{"tags":["test:test-update_a_monitor_notification_rule_returns_not_found_response-1748486182","host:abc"]},"name":"updated rule","recipients":["slack-test-channel","jira-test"]},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-notification-rule"}}' headers: Accept: diff --git a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-OK-response.frozen b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-OK-response.frozen index b7d42a448905..c2c5ef4ceb12 100644 --- a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-OK-response.frozen @@ -1 +1 @@ -2025-04-10T10:29:57.629Z \ No newline at end of file +2025-05-29T02:36:22.508Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-OK-response.yml b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-OK-response.yml index dc2ac5e175e2..c5660af1c1e4 100644 --- a/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-OK-response.yml +++ b/cassettes/features/v2/monitors/Update-a-monitor-notification-rule-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 10 Apr 2025 10:29:57 GMT +- recorded_at: Thu, 29 May 2025 02:36:22 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"filter":{"tags":["app:test-update_a_monitor_notification_rule_returns_ok_response-1744280997"]},"name":"test + string: '{"data":{"attributes":{"filter":{"tags":["app:test-update_a_monitor_notification_rule_returns_ok_response-1748486182"]},"name":"test rule","recipients":["slack-monitor-app"]},"type":"monitor-notification-rule"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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"}}]} + string: '{"data":{"type":"monitor-notification-rule","attributes":{"modified_at":"1970-01-01T00:00:00+00:00","created_at":"2025-05-29T02:36:22.625956+00:00","filter":{"tags":["app:test-update_a_monitor_notification_rule_returns_ok_response-1748486182"]},"name":"test + rule","recipients":["slack-monitor-app"]},"id":"48a37c74-cf93-488c-b070-210d650b5687","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-05-06T01:37:11.870914+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"}}]} ' headers: @@ -25,24 +25,24 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:57 GMT +- recorded_at: Thu, 29 May 2025 02:36:22 GMT request: body: encoding: UTF-8 - string: '{"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"}}' + string: '{"data":{"attributes":{"filter":{"tags":["test:test-update_a_monitor_notification_rule_returns_ok_response-1748486182","host:abc"]},"name":"updated + rule","recipients":["slack-test-channel"]},"id":"48a37c74-cf93-488c-b070-210d650b5687","type":"monitor-notification-rule"}}' headers: Accept: - application/json Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/da2c8a3b-94ea-49be-a85b-39c5eff99d6a + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/48a37c74-cf93-488c-b070-210d650b5687 response: body: encoding: UTF-8 - string: '{"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"}}]} + string: '{"data":{"type":"monitor-notification-rule","attributes":{"recipients":["slack-test-channel"],"modified_at":"2025-05-29T02:36:22.798426+00:00","name":"updated + rule","filter":{"tags":["test:test-update_a_monitor_notification_rule_returns_ok_response-1748486182","host:abc"]},"created_at":"2025-05-29T02:36:22.625956+00:00"},"id":"48a37c74-cf93-488c-b070-210d650b5687","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-05-06T01:37:11.870914+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"}}]} ' headers: @@ -51,14 +51,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 10 Apr 2025 10:29:57 GMT +- recorded_at: Thu, 29 May 2025 02:36:22 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/da2c8a3b-94ea-49be-a85b-39c5eff99d6a + uri: https://api.datadoghq.com/api/v2/monitor/notification_rule/48a37c74-cf93-488c-b070-210d650b5687 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Bad-Request-response.frozen b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..a212bb13287a --- /dev/null +++ b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:22.996Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Bad-Request-response.yml b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..a39d0653b297 --- /dev/null +++ b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Bad-Request-response.yml @@ -0,0 +1,74 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"It''s a threshold","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["category:test"],"template_variables":[{"available_values":[],"defaults":["cats"],"name":"scope"}],"title":"api + spec given template test-update_a_monitor_user_template_to_a_new_version_returns_bad_request_response-1748486182"},"type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"version":0,"created":"2025-05-29T02:36:23.224659+00:00","template_variables":[{"available_values":[],"name":"scope","defaults":["cats"]}],"monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"title":"api spec given template test-update_a_monitor_user_template_to_a_new_version_returns_bad_request_response-1748486182","description":"It''s + a threshold","tags":["category:test"],"creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":"2025-05-29T02:36:23.224659+00:00"},"id":"a68243ec-7e1c-40da-a99d-8966282c3726"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-update_a_monitor_user_template_to_a_new_version_returns_bad_request_response-1748486182"},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/monitor/template/a68243ec-7e1c-40da-a99d-8966282c3726 + response: + body: + encoding: UTF-8 + string: '{"errors":["Invalid monitor_definition or template variables: Monitor + definition cannot be empty."]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +- recorded_at: Thu, 29 May 2025 02:36:22 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/monitor/template/a68243ec-7e1c-40da-a99d-8966282c3726 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..ab9a0c9a5ac3 --- /dev/null +++ b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:23.616Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Not-Found-response.yml new file mode 100644 index 000000000000..e209fc9ddcea --- /dev/null +++ b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-Not-Found-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{"message":"A + msg.","name":"A name test-update_a_monitor_user_template_to_a_new_version_returns_not_found_response-1748486183","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-update_a_monitor_user_template_to_a_new_version_returns_not_found_response-1748486183"},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/monitor/template/00000000-0000-1234-0000-000000000000 + response: + body: + encoding: UTF-8 + string: '{"errors":["Monitor template not found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-OK-response.frozen b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-OK-response.frozen new file mode 100644 index 000000000000..5eb2e1934847 --- /dev/null +++ b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:23.765Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-OK-response.yml b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-OK-response.yml new file mode 100644 index 000000000000..3cf907f61d59 --- /dev/null +++ b/cassettes/features/v2/monitors/Update-a-monitor-user-template-to-a-new-version-returns-OK-response.yml @@ -0,0 +1,90 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"It''s a threshold","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["category:test"],"template_variables":[{"available_values":[],"defaults":["cats"],"name":"scope"}],"title":"api + spec given template test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183"},"type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"template_variables":[{"name":"scope","available_values":[],"defaults":["cats"]}],"monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","created":"2025-05-29T02:36:23.954533+00:00","modified":"2025-05-29T02:36:23.954533+00:00","version":0,"title":"api + spec given template test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183","tags":["category:test"],"description":"It''s + a threshold"},"id":"fefd62df-924a-4438-a697-f7e6ccbad77e"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{"message":"A + msg.","name":"A name test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183"},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/monitor/template/fefd62df-924a-4438-a697-f7e6ccbad77e + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"title":"Postgres + DB test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183","creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","modified":"2025-05-29T02:36:24.215009+00:00","version":1,"description":"A + description.","versions":[{"title":"api spec given template test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183","version":0,"description":"It''s + a threshold","id":"fefd62df-924a-4438-a697-f7e6ccbad77e","created":"2025-05-29T02:36:23.954533+00:00","monitor_definition":{"name":"High + Error Rate on service","type":"query alert","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","message":"cats"},"template_variables":[{"defaults":["cats"],"available_values":[],"name":"scope"}],"tags":["category:test"]},{"title":"Postgres + DB test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183","version":1,"description":"A + description.","id":"5e4cd0de-4940-4060-8ffd-2ff13a0b3f5e","created":"2025-05-29T02:36:23.954533+00:00","monitor_definition":{"name":"A + name test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183","type":"query + alert","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100","message":"A + msg."},"template_variables":[{"defaults":["defaultValue"],"available_values":["value1","value2"],"name":"regionName","tag_key":"datacenter"}],"tags":["integration:Azure"]}],"created":"2025-05-29T02:36:23.954533+00:00","monitor_definition":{"message":"A + msg.","name":"A name test-update_a_monitor_user_template_to_a_new_version_returns_ok_response-1748486183","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"template_variables":[{"defaults":["defaultValue"],"available_values":["value1","value2"],"name":"regionName","tag_key":"datacenter"}],"tags":["integration:Azure"]},"id":"fefd62df-924a-4438-a697-f7e6ccbad77e"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:23 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/monitor/template/fefd62df-924a-4438-a697-f7e6ccbad77e + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-Bad-Request-response.frozen b/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..d87de5207baa --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:24.411Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-Bad-Request-response.yml b/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..42f81b86c62b --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-Bad-Request-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-validate_a_monitor_user_template_returns_bad_request_response-1748486184"},"type":"monitor-user-template"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template/validate + response: + body: + encoding: UTF-8 + string: '{"errors":["Invalid monitor_definition or template variables: Monitor + definition cannot be empty."]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-OK-response.frozen b/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-OK-response.frozen new file mode 100644 index 000000000000..31ae01fbc058 --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:24.538Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-OK-response.yml b/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-OK-response.yml new file mode 100644 index 000000000000..c564dee7a503 --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-a-monitor-user-template-returns-OK-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{"message":"A + msg.","name":"A name test-validate_a_monitor_user_template_returns_ok_response-1748486184","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-validate_a_monitor_user_template_returns_ok_response-1748486184"},"type":"monitor-user-template"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template/validate + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Bad-Request-response.frozen b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..e32f4a20fc37 --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:24.721Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Bad-Request-response.yml b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..93f8714a4f5f --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Bad-Request-response.yml @@ -0,0 +1,75 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"It''s a threshold","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["category:test"],"template_variables":[{"available_values":[],"defaults":["cats"],"name":"scope"}],"title":"api + spec given template test-validate_an_existing_monitor_user_template_returns_bad_request_response-1748486184"},"type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["category:test"],"created":"2025-05-29T02:36:24.928104+00:00","modified":"2025-05-29T02:36:24.928104+00:00","title":"api + spec given template test-validate_an_existing_monitor_user_template_returns_bad_request_response-1748486184","version":0,"template_variables":[{"name":"scope","defaults":["cats"],"available_values":[]}],"description":"It''s + a threshold"},"id":"599fecff-7834-42bd-976b-c2d145f42579"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-validate_an_existing_monitor_user_template_returns_bad_request_response-1748486184"},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-user-template"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template/599fecff-7834-42bd-976b-c2d145f42579/validate + response: + body: + encoding: UTF-8 + string: '{"errors":["Invalid monitor_definition or template variables: Monitor + definition cannot be empty."]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +- recorded_at: Thu, 29 May 2025 02:36:24 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/monitor/template/599fecff-7834-42bd-976b-c2d145f42579 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Not-Found-response.frozen b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..5262ab4af97c --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:25.252Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Not-Found-response.yml b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Not-Found-response.yml new file mode 100644 index 000000000000..dea1ce97de19 --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-Not-Found-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:25 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{"message":"A + msg.","name":"A name test-validate_an_existing_monitor_user_template_returns_not_found_response-1748486185","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-validate_an_existing_monitor_user_template_returns_not_found_response-1748486185"},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-user-template"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template/00000000-0000-1234-0000-000000000000/validate + response: + body: + encoding: UTF-8 + string: '{"errors":["Monitor template not found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-OK-response.frozen b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-OK-response.frozen new file mode 100644 index 000000000000..84fcf64770a8 --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-05-29T02:36:25.384Z \ No newline at end of file diff --git a/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-OK-response.yml b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-OK-response.yml new file mode 100644 index 000000000000..61a3bc1df0dc --- /dev/null +++ b/cassettes/features/v2/monitors/Validate-an-existing-monitor-user-template-returns-OK-response.yml @@ -0,0 +1,75 @@ +http_interactions: +- recorded_at: Thu, 29 May 2025 02:36:25 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"It''s a threshold","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["category:test"],"template_variables":[{"available_values":[],"defaults":["cats"],"name":"scope"}],"title":"api + spec given template test-validate_an_existing_monitor_user_template_returns_ok_response-1748486185"},"type":"monitor-user-template"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"monitor-user-template","attributes":{"created":"2025-05-29T02:36:25.594440+00:00","version":0,"description":"It''s + a threshold","tags":["category:test"],"modified":"2025-05-29T02:36:25.594440+00:00","template_variables":[{"defaults":["cats"],"available_values":[],"name":"scope"}],"creator_uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","monitor_definition":{"message":"cats","name":"High + Error Rate on service","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"title":"api spec given template test-validate_an_existing_monitor_user_template_returns_ok_response-1748486185"},"id":"dc86b1ba-9e7c-40cf-8859-777c53e4f1a2"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 29 May 2025 02:36:25 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"A description.","monitor_definition":{"message":"A + msg.","name":"A name test-validate_an_existing_monitor_user_template_returns_ok_response-1748486185","query":"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} + > 100","type":"query alert"},"tags":["integration:Azure"],"template_variables":[{"available_values":["value1","value2"],"defaults":["defaultValue"],"name":"regionName","tag_key":"datacenter"}],"title":"Postgres + DB test-validate_an_existing_monitor_user_template_returns_ok_response-1748486185"},"id":"00000000-0000-1234-0000-000000000000","type":"monitor-user-template"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/monitor/template/dc86b1ba-9e7c-40cf-8859-777c53e4f1a2/validate + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +- recorded_at: Thu, 29 May 2025 02:36:25 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/monitor/template/dc86b1ba-9e7c-40cf-8859-777c53e4f1a2 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/monitors/CreateMonitorUserTemplate.rb b/examples/v2/monitors/CreateMonitorUserTemplate.rb new file mode 100644 index 000000000000..1856e3f8d58f --- /dev/null +++ b/examples/v2/monitors/CreateMonitorUserTemplate.rb @@ -0,0 +1,37 @@ +# Create a monitor user template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_monitor_user_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::MonitorsAPI.new + +body = DatadogAPIClient::V2::MonitorUserTemplateCreateRequest.new({ + data: DatadogAPIClient::V2::MonitorUserTemplateCreateData.new({ + attributes: DatadogAPIClient::V2::MonitorUserTemplateRequestAttributes.new({ + description: "A description.", + monitor_definition: { + "message": "A msg.", "name": "A name example-monitor", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert", + }, + tags: [ + "integration:Azure", + ], + template_variables: [ + DatadogAPIClient::V2::MonitorUserTemplateTemplateVariablesItems.new({ + available_values: [ + "value1", + "value2", + ], + defaults: [ + "defaultValue", + ], + name: "regionName", + tag_key: "datacenter", + }), + ], + title: "Postgres DB example-monitor", + }), + type: DatadogAPIClient::V2::MonitorUserTemplateResourceType::MONITOR_USER_TEMPLATE, + }), +}) +p api_instance.create_monitor_user_template(body) diff --git a/examples/v2/monitors/DeleteMonitorUserTemplate.rb b/examples/v2/monitors/DeleteMonitorUserTemplate.rb new file mode 100644 index 000000000000..3ba5acce449a --- /dev/null +++ b/examples/v2/monitors/DeleteMonitorUserTemplate.rb @@ -0,0 +1,8 @@ +# Delete a monitor user template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_monitor_user_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::MonitorsAPI.new +api_instance.delete_monitor_user_template("template_id") diff --git a/examples/v2/monitors/GetMonitorUserTemplate.rb b/examples/v2/monitors/GetMonitorUserTemplate.rb new file mode 100644 index 000000000000..6a2af8989f05 --- /dev/null +++ b/examples/v2/monitors/GetMonitorUserTemplate.rb @@ -0,0 +1,11 @@ +# Get a monitor user template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_monitor_user_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::MonitorsAPI.new + +# there is a valid "monitor_user_template" in the system +MONITOR_USER_TEMPLATE_DATA_ID = ENV["MONITOR_USER_TEMPLATE_DATA_ID"] +p api_instance.get_monitor_user_template(MONITOR_USER_TEMPLATE_DATA_ID) diff --git a/examples/v2/monitors/ListMonitorUserTemplates.rb b/examples/v2/monitors/ListMonitorUserTemplates.rb new file mode 100644 index 000000000000..876e0bcb4ea4 --- /dev/null +++ b/examples/v2/monitors/ListMonitorUserTemplates.rb @@ -0,0 +1,8 @@ +# Get all monitor user templates returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_monitor_user_templates".to_sym] = true +end +api_instance = DatadogAPIClient::V2::MonitorsAPI.new +p api_instance.list_monitor_user_templates() diff --git a/examples/v2/monitors/UpdateMonitorUserTemplate.rb b/examples/v2/monitors/UpdateMonitorUserTemplate.rb new file mode 100644 index 000000000000..bfae87a83880 --- /dev/null +++ b/examples/v2/monitors/UpdateMonitorUserTemplate.rb @@ -0,0 +1,41 @@ +# Update a monitor user template to a new version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_monitor_user_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::MonitorsAPI.new + +# there is a valid "monitor_user_template" in the system +MONITOR_USER_TEMPLATE_DATA_ID = ENV["MONITOR_USER_TEMPLATE_DATA_ID"] + +body = DatadogAPIClient::V2::MonitorUserTemplateUpdateRequest.new({ + data: DatadogAPIClient::V2::MonitorUserTemplateUpdateData.new({ + attributes: DatadogAPIClient::V2::MonitorUserTemplateRequestAttributes.new({ + description: "A description.", + monitor_definition: { + "message": "A msg.", "name": "A name example-monitor", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert", + }, + tags: [ + "integration:Azure", + ], + template_variables: [ + DatadogAPIClient::V2::MonitorUserTemplateTemplateVariablesItems.new({ + available_values: [ + "value1", + "value2", + ], + defaults: [ + "defaultValue", + ], + name: "regionName", + tag_key: "datacenter", + }), + ], + title: "Postgres DB example-monitor", + }), + id: MONITOR_USER_TEMPLATE_DATA_ID, + type: DatadogAPIClient::V2::MonitorUserTemplateResourceType::MONITOR_USER_TEMPLATE, + }), +}) +p api_instance.update_monitor_user_template(MONITOR_USER_TEMPLATE_DATA_ID, body) diff --git a/examples/v2/monitors/ValidateExistingMonitorUserTemplate.rb b/examples/v2/monitors/ValidateExistingMonitorUserTemplate.rb new file mode 100644 index 000000000000..bec367597cae --- /dev/null +++ b/examples/v2/monitors/ValidateExistingMonitorUserTemplate.rb @@ -0,0 +1,41 @@ +# Validate an existing monitor user template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.validate_existing_monitor_user_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::MonitorsAPI.new + +# there is a valid "monitor_user_template" in the system +MONITOR_USER_TEMPLATE_DATA_ID = ENV["MONITOR_USER_TEMPLATE_DATA_ID"] + +body = DatadogAPIClient::V2::MonitorUserTemplateUpdateRequest.new({ + data: DatadogAPIClient::V2::MonitorUserTemplateUpdateData.new({ + attributes: DatadogAPIClient::V2::MonitorUserTemplateRequestAttributes.new({ + description: "A description.", + monitor_definition: { + "message": "A msg.", "name": "A name example-monitor", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert", + }, + tags: [ + "integration:Azure", + ], + template_variables: [ + DatadogAPIClient::V2::MonitorUserTemplateTemplateVariablesItems.new({ + available_values: [ + "value1", + "value2", + ], + defaults: [ + "defaultValue", + ], + name: "regionName", + tag_key: "datacenter", + }), + ], + title: "Postgres DB example-monitor", + }), + id: MONITOR_USER_TEMPLATE_DATA_ID, + type: DatadogAPIClient::V2::MonitorUserTemplateResourceType::MONITOR_USER_TEMPLATE, + }), +}) +api_instance.validate_existing_monitor_user_template(MONITOR_USER_TEMPLATE_DATA_ID, body) diff --git a/examples/v2/monitors/ValidateMonitorUserTemplate.rb b/examples/v2/monitors/ValidateMonitorUserTemplate.rb new file mode 100644 index 000000000000..bb557ed28adf --- /dev/null +++ b/examples/v2/monitors/ValidateMonitorUserTemplate.rb @@ -0,0 +1,37 @@ +# Validate a monitor user template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.validate_monitor_user_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::MonitorsAPI.new + +body = DatadogAPIClient::V2::MonitorUserTemplateCreateRequest.new({ + data: DatadogAPIClient::V2::MonitorUserTemplateCreateData.new({ + attributes: DatadogAPIClient::V2::MonitorUserTemplateRequestAttributes.new({ + description: "A description.", + monitor_definition: { + "message": "A msg.", "name": "A name example-monitor", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert", + }, + tags: [ + "integration:Azure", + ], + template_variables: [ + DatadogAPIClient::V2::MonitorUserTemplateTemplateVariablesItems.new({ + available_values: [ + "value1", + "value2", + ], + defaults: [ + "defaultValue", + ], + name: "regionName", + tag_key: "datacenter", + }), + ], + title: "Postgres DB example-monitor", + }), + type: DatadogAPIClient::V2::MonitorUserTemplateResourceType::MONITOR_USER_TEMPLATE, + }), +}) +api_instance.validate_monitor_user_template(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 3704d9f4e02f..e47465a5121c 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2056,6 +2056,27 @@ "policy_id" => "String", "body" => "MonitorConfigPolicyEditRequest", }, + "v2.CreateMonitorUserTemplate" => { + "body" => "MonitorUserTemplateCreateRequest", + }, + "v2.ValidateMonitorUserTemplate" => { + "body" => "MonitorUserTemplateCreateRequest", + }, + "v2.DeleteMonitorUserTemplate" => { + "template_id" => "String", + }, + "v2.GetMonitorUserTemplate" => { + "template_id" => "String", + "with_all_versions" => "Boolean", + }, + "v2.UpdateMonitorUserTemplate" => { + "template_id" => "String", + "body" => "MonitorUserTemplateUpdateRequest", + }, + "v2.ValidateExistingMonitorUserTemplate" => { + "template_id" => "String", + "body" => "MonitorUserTemplateUpdateRequest", + }, "v2.ListDevices" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/given.json b/features/v2/given.json index 85541755d9e2..9a7a55576893 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -484,6 +484,18 @@ "tag": "Monitors", "operationId": "CreateMonitorConfigPolicy" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"monitor-user-template\",\n \"attributes\": {\n \"description\": \"It's a threshold\",\n \"title\": \"api spec given template {{ unique_lower }}\",\n \"monitor_definition\": {\n \"message\": \"cats\",\n \"name\": \"High Error Rate on service\",\n \"query\": \"avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100\",\n \"type\": \"query alert\"\n },\n \"template_variables\": [{\"name\": \"scope\", \"available_values\": [], \"defaults\": [\"cats\"]}],\n \"tags\": [\"category:test\"]\n }\n }\n}" + } + ], + "step": "there is a valid \"monitor_user_template\" in the system", + "key": "monitor_user_template", + "tag": "Monitors", + "operationId": "CreateMonitorUserTemplate" + }, { "parameters": [ { diff --git a/features/v2/monitors.feature b/features/v2/monitors.feature index 5620258697d2..ddc106e02b99 100644 --- a/features/v2/monitors.feature +++ b/features/v2/monitors.feature @@ -46,6 +46,22 @@ Feature: Monitors Then the response status is 200 OK And the response "data.attributes.name" is equal to "test rule" + @skip-validation @team:DataDog/monitor-app + Scenario: Create a monitor user template returns "Bad Request" response + Given new "CreateMonitorUserTemplate" request + And operation "CreateMonitorUserTemplate" enabled + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "type": "monitor-user-template"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/monitor-app + Scenario: Create a monitor user template returns "OK" response + Given new "CreateMonitorUserTemplate" request + And operation "CreateMonitorUserTemplate" enabled + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {"message": "A msg.", "name": "A name {{ unique_lower }}", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert"}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "type": "monitor-user-template"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/monitor-app Scenario: Delete a monitor configuration policy returns "Bad Request" response Given new "DeleteMonitorConfigPolicy" request @@ -85,6 +101,22 @@ Feature: Monitors When the request is sent Then the response status is 204 OK + @team:DataDog/monitor-app + Scenario: Delete a monitor user template returns "Not Found" response + Given new "DeleteMonitorUserTemplate" request + And operation "DeleteMonitorUserTemplate" enabled + And request contains "template_id" parameter with value "00000000-0000-1234-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/monitor-app + Scenario: Delete a monitor user template returns "OK" response + Given operation "DeleteMonitorUserTemplate" enabled + And new "DeleteMonitorUserTemplate" request + And request contains "template_id" parameter from "REPLACE.ME" + 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 @@ -154,6 +186,24 @@ Feature: Monitors Then the response status is 200 OK And the response "data.attributes.name" is equal to "test rule" + @team:DataDog/monitor-app + Scenario: Get a monitor user template returns "Not Found" response + Given new "GetMonitorUserTemplate" request + And operation "GetMonitorUserTemplate" enabled + And request contains "template_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 user template returns "OK" response + Given there is a valid "monitor_user_template" in the system + And new "GetMonitorUserTemplate" request + And operation "GetMonitorUserTemplate" enabled + And request contains "template_id" parameter from "monitor_user_template.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "monitor-user-template" + @team:DataDog/monitor-app Scenario: Get all monitor configuration policies returns "OK" response Given there is a valid "monitor_configuration_policy" in the system @@ -176,6 +226,15 @@ Feature: Monitors And the response "data" has length 1 And the response "data" has item with field "attributes.name" with value "test rule" + @team:DataDog/monitor-app + Scenario: Get all monitor user templates returns "OK" response + Given there is a valid "monitor_user_template" in the system + And new "ListMonitorUserTemplates" request + And operation "ListMonitorUserTemplates" enabled + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + @skip-validation @team:DataDog/monitor-app Scenario: Update a monitor notification rule returns "Bad Request" response Given operation "UpdateMonitorNotificationRule" enabled @@ -205,3 +264,77 @@ Feature: Monitors When the request is sent Then the response status is 200 OK And the response "data.attributes.name" is equal to "updated rule" + + @skip-validation @team:DataDog/monitor-app + Scenario: Update a monitor user template to a new version returns "Bad Request" response + Given there is a valid "monitor_user_template" in the system + And operation "UpdateMonitorUserTemplate" enabled + And new "UpdateMonitorUserTemplate" request + And request contains "template_id" parameter from "monitor_user_template.data.id" + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "id": "00000000-0000-1234-0000-000000000000", "type": "monitor-user-template"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/monitor-app + Scenario: Update a monitor user template to a new version returns "Not Found" response + Given new "UpdateMonitorUserTemplate" request + And operation "UpdateMonitorUserTemplate" enabled + And request contains "template_id" parameter with value "00000000-0000-1234-0000-000000000000" + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {"message": "A msg.", "name": "A name {{ unique_lower }}", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert"}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "id": "00000000-0000-1234-0000-000000000000", "type": "monitor-user-template"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/monitor-app + Scenario: Update a monitor user template to a new version returns "OK" response + Given there is a valid "monitor_user_template" in the system + And new "UpdateMonitorUserTemplate" request + And operation "UpdateMonitorUserTemplate" enabled + And request contains "template_id" parameter from "monitor_user_template.data.id" + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {"message": "A msg.", "name": "A name {{ unique_lower }}", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert"}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "id": "00000000-0000-1234-0000-000000000000", "type": "monitor-user-template"}} + When the request is sent + Then the response status is 200 OK + + @skip-validation @team:DataDog/monitor-app + Scenario: Validate a monitor user template returns "Bad Request" response + Given new "ValidateMonitorUserTemplate" request + And operation "ValidateMonitorUserTemplate" enabled + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "type": "monitor-user-template"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/monitor-app + Scenario: Validate a monitor user template returns "OK" response + Given new "ValidateMonitorUserTemplate" request + And operation "ValidateMonitorUserTemplate" enabled + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {"message": "A msg.", "name": "A name {{ unique_lower }}", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert"}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "type": "monitor-user-template"}} + When the request is sent + Then the response status is 204 OK + + @skip-validation @team:DataDog/monitor-app + Scenario: Validate an existing monitor user template returns "Bad Request" response + Given there is a valid "monitor_user_template" in the system + And new "ValidateExistingMonitorUserTemplate" request + And operation "ValidateExistingMonitorUserTemplate" enabled + And request contains "template_id" parameter from "monitor_user_template.data.id" + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "id": "00000000-0000-1234-0000-000000000000", "type": "monitor-user-template"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/monitor-app + Scenario: Validate an existing monitor user template returns "Not Found" response + Given new "ValidateExistingMonitorUserTemplate" request + And operation "ValidateExistingMonitorUserTemplate" enabled + And request contains "template_id" parameter with value "00000000-0000-1234-0000-000000000000" + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {"message": "A msg.", "name": "A name {{ unique_lower }}", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert"}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "id": "00000000-0000-1234-0000-000000000000", "type": "monitor-user-template"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/monitor-app + Scenario: Validate an existing monitor user template returns "OK" response + Given there is a valid "monitor_user_template" in the system + And new "ValidateExistingMonitorUserTemplate" request + And operation "ValidateExistingMonitorUserTemplate" enabled + And request contains "template_id" parameter from "monitor_user_template.data.id" + And body with value {"data": {"attributes": {"description": "A description.", "monitor_definition": {"message": "A msg.", "name": "A name {{ unique_lower }}", "query": "avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", "type": "query alert"}, "tags": ["integration:Azure"], "template_variables": [{"available_values": ["value1", "value2"], "defaults": ["defaultValue"], "name": "regionName", "tag_key": "datacenter"}], "title": "Postgres DB {{ unique_lower }}"}, "id": "00000000-0000-1234-0000-000000000000", "type": "monitor-user-template"}} + When the request is sent + Then the response status is 204 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index e81cb7b7ce12..761a726fc68b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1884,6 +1884,55 @@ "type": "idempotent" } }, + "ListMonitorUserTemplates": { + "tag": "Monitors", + "undo": { + "type": "safe" + } + }, + "CreateMonitorUserTemplate": { + "tag": "Monitors", + "undo": { + "operationId": "DeleteMonitorUserTemplate", + "parameters": [ + { + "name": "template_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ValidateMonitorUserTemplate": { + "tag": "Monitors", + "undo": { + "type": "idempotent" + } + }, + "DeleteMonitorUserTemplate": { + "tag": "Monitors", + "undo": { + "type": "idempotent" + } + }, + "GetMonitorUserTemplate": { + "tag": "Monitors", + "undo": { + "type": "safe" + } + }, + "UpdateMonitorUserTemplate": { + "tag": "Monitors", + "undo": { + "type": "idempotent" + } + }, + "ValidateExistingMonitorUserTemplate": { + "tag": "Monitors", + "undo": { + "type": "idempotent" + } + }, "ListMonitorDowntimes": { "tag": "Downtimes", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 6b8e383a2605..0b93894dc3b0 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -242,10 +242,17 @@ def initialize "v2.update_aws_account": false, "v2.list_aws_logs_services": false, "v2.create_monitor_notification_rule": false, + "v2.create_monitor_user_template": false, "v2.delete_monitor_notification_rule": false, + "v2.delete_monitor_user_template": false, "v2.get_monitor_notification_rule": false, "v2.get_monitor_notification_rules": false, + "v2.get_monitor_user_template": false, + "v2.list_monitor_user_templates": false, "v2.update_monitor_notification_rule": false, + "v2.update_monitor_user_template": false, + "v2.validate_existing_monitor_user_template": false, + "v2.validate_monitor_user_template": false, "v2.get_aggregated_connections": false, "v2.create_pipeline": false, "v2.delete_pipeline": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 3c4246dc9858..84d7c7a8d31b 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2363,6 +2363,20 @@ def overrides "v2.monitor_trigger" => "MonitorTrigger", "v2.monitor_trigger_wrapper" => "MonitorTriggerWrapper", "v2.monitor_type" => "MonitorType", + "v2.monitor_user_template" => "MonitorUserTemplate", + "v2.monitor_user_template_create_data" => "MonitorUserTemplateCreateData", + "v2.monitor_user_template_create_request" => "MonitorUserTemplateCreateRequest", + "v2.monitor_user_template_create_response" => "MonitorUserTemplateCreateResponse", + "v2.monitor_user_template_list_response" => "MonitorUserTemplateListResponse", + "v2.monitor_user_template_request_attributes" => "MonitorUserTemplateRequestAttributes", + "v2.monitor_user_template_resource_type" => "MonitorUserTemplateResourceType", + "v2.monitor_user_template_response" => "MonitorUserTemplateResponse", + "v2.monitor_user_template_response_attributes" => "MonitorUserTemplateResponseAttributes", + "v2.monitor_user_template_response_data" => "MonitorUserTemplateResponseData", + "v2.monitor_user_template_response_data_with_versions" => "MonitorUserTemplateResponseDataWithVersions", + "v2.monitor_user_template_template_variables_items" => "MonitorUserTemplateTemplateVariablesItems", + "v2.monitor_user_template_update_data" => "MonitorUserTemplateUpdateData", + "v2.monitor_user_template_update_request" => "MonitorUserTemplateUpdateRequest", "v2.monthly_cost_attribution_attributes" => "MonthlyCostAttributionAttributes", "v2.monthly_cost_attribution_body" => "MonthlyCostAttributionBody", "v2.monthly_cost_attribution_meta" => "MonthlyCostAttributionMeta", @@ -3185,6 +3199,7 @@ def overrides "v2.shift_data_relationships_user_data_type" => "ShiftDataRelationshipsUserDataType", "v2.shift_data_type" => "ShiftDataType", "v2.shift_included" => "ShiftIncluded", + "v2.simple_monitor_user_template" => "SimpleMonitorUserTemplate", "v2.single_aggregated_connection_response_array" => "SingleAggregatedConnectionResponseArray", "v2.single_aggregated_connection_response_data" => "SingleAggregatedConnectionResponseData", "v2.single_aggregated_connection_response_data_attributes" => "SingleAggregatedConnectionResponseDataAttributes", diff --git a/lib/datadog_api_client/v2/api/monitors_api.rb b/lib/datadog_api_client/v2/api/monitors_api.rb index 6355b15a8688..54ac1e1644b0 100644 --- a/lib/datadog_api_client/v2/api/monitors_api.rb +++ b/lib/datadog_api_client/v2/api/monitors_api.rb @@ -163,6 +163,79 @@ def create_monitor_notification_rule_with_http_info(body, opts = {}) return data, status_code, headers end + # Create a monitor user template. + # + # @see #create_monitor_user_template_with_http_info + def create_monitor_user_template(body, opts = {}) + data, _status_code, _headers = create_monitor_user_template_with_http_info(body, opts) + data + end + + # Create a monitor user template. + # + # Create a new monitor user template. + # + # @param body [MonitorUserTemplateCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(MonitorUserTemplateCreateResponse, Integer, Hash)>] MonitorUserTemplateCreateResponse data, response status code and response headers + def create_monitor_user_template_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_monitor_user_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_monitor_user_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_monitor_user_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MonitorsAPI.create_monitor_user_template ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MonitorsAPI.create_monitor_user_template" + end + # resource path + local_var_path = '/api/v2/monitor/template' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MonitorUserTemplateCreateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_monitor_user_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MonitorsAPI#create_monitor_user_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a monitor configuration policy. # # @see #delete_monitor_config_policy_with_http_info @@ -299,6 +372,77 @@ def delete_monitor_notification_rule_with_http_info(rule_id, opts = {}) return data, status_code, headers end + # Delete a monitor user template. + # + # @see #delete_monitor_user_template_with_http_info + def delete_monitor_user_template(template_id, opts = {}) + delete_monitor_user_template_with_http_info(template_id, opts) + nil + end + + # Delete a monitor user template. + # + # Delete an existing monitor user template by its ID. + # + # @param template_id [String] ID of the monitor user template. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_monitor_user_template_with_http_info(template_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_monitor_user_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_monitor_user_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_monitor_user_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MonitorsAPI.delete_monitor_user_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling MonitorsAPI.delete_monitor_user_template" + end + # resource path + local_var_path = '/api/v2/monitor/template/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_monitor_user_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MonitorsAPI#delete_monitor_user_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a monitor configuration policy. # # @see #get_monitor_config_policy_with_http_info @@ -505,6 +649,79 @@ def get_monitor_notification_rules_with_http_info(opts = {}) return data, status_code, headers end + # Get a monitor user template. + # + # @see #get_monitor_user_template_with_http_info + def get_monitor_user_template(template_id, opts = {}) + data, _status_code, _headers = get_monitor_user_template_with_http_info(template_id, opts) + data + end + + # Get a monitor user template. + # + # Retrieve a monitor user template by its ID. + # + # @param template_id [String] ID of the monitor user template. + # @param opts [Hash] the optional parameters + # @option opts [Boolean] :with_all_versions Whether to include all versions of the template in the response in the versions field. + # @return [Array<(MonitorUserTemplateResponse, Integer, Hash)>] MonitorUserTemplateResponse data, response status code and response headers + def get_monitor_user_template_with_http_info(template_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_monitor_user_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_monitor_user_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_monitor_user_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MonitorsAPI.get_monitor_user_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling MonitorsAPI.get_monitor_user_template" + end + # resource path + local_var_path = '/api/v2/monitor/template/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'with_all_versions'] = opts[:'with_all_versions'] if !opts[:'with_all_versions'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MonitorUserTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_monitor_user_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MonitorsAPI#get_monitor_user_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get all monitor configuration policies. # # @see #list_monitor_config_policies_with_http_info @@ -565,6 +782,72 @@ def list_monitor_config_policies_with_http_info(opts = {}) return data, status_code, headers end + # Get all monitor user templates. + # + # @see #list_monitor_user_templates_with_http_info + def list_monitor_user_templates(opts = {}) + data, _status_code, _headers = list_monitor_user_templates_with_http_info(opts) + data + end + + # Get all monitor user templates. + # + # Retrieve all monitor user templates. + # + # @param opts [Hash] the optional parameters + # @return [Array<(MonitorUserTemplateListResponse, Integer, Hash)>] MonitorUserTemplateListResponse data, response status code and response headers + def list_monitor_user_templates_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_monitor_user_templates".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_monitor_user_templates") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_monitor_user_templates")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MonitorsAPI.list_monitor_user_templates ...' + end + # resource path + local_var_path = '/api/v2/monitor/template' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MonitorUserTemplateListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_monitor_user_templates, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MonitorsAPI#list_monitor_user_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Edit a monitor configuration policy. # # @see #update_monitor_config_policy_with_http_info @@ -714,5 +997,234 @@ def update_monitor_notification_rule_with_http_info(rule_id, body, opts = {}) end return data, status_code, headers end + + # Update a monitor user template to a new version. + # + # @see #update_monitor_user_template_with_http_info + def update_monitor_user_template(template_id, body, opts = {}) + data, _status_code, _headers = update_monitor_user_template_with_http_info(template_id, body, opts) + data + end + + # Update a monitor user template to a new version. + # + # Creates a new version of an existing monitor user template. + # + # @param template_id [String] ID of the monitor user template. + # @param body [MonitorUserTemplateUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(MonitorUserTemplateResponse, Integer, Hash)>] MonitorUserTemplateResponse data, response status code and response headers + def update_monitor_user_template_with_http_info(template_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_monitor_user_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_monitor_user_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_monitor_user_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MonitorsAPI.update_monitor_user_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling MonitorsAPI.update_monitor_user_template" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MonitorsAPI.update_monitor_user_template" + end + # resource path + local_var_path = '/api/v2/monitor/template/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MonitorUserTemplateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_monitor_user_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MonitorsAPI#update_monitor_user_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Validate an existing monitor user template. + # + # @see #validate_existing_monitor_user_template_with_http_info + def validate_existing_monitor_user_template(template_id, body, opts = {}) + validate_existing_monitor_user_template_with_http_info(template_id, body, opts) + nil + end + + # Validate an existing monitor user template. + # + # Validate the structure and content of an existing monitor user template being updated to a new version. + # + # @param template_id [String] ID of the monitor user template. + # @param body [MonitorUserTemplateUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def validate_existing_monitor_user_template_with_http_info(template_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.validate_existing_monitor_user_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.validate_existing_monitor_user_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.validate_existing_monitor_user_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MonitorsAPI.validate_existing_monitor_user_template ...' + end + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling MonitorsAPI.validate_existing_monitor_user_template" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MonitorsAPI.validate_existing_monitor_user_template" + end + # resource path + local_var_path = '/api/v2/monitor/template/{template_id}/validate'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :validate_existing_monitor_user_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MonitorsAPI#validate_existing_monitor_user_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Validate a monitor user template. + # + # @see #validate_monitor_user_template_with_http_info + def validate_monitor_user_template(body, opts = {}) + validate_monitor_user_template_with_http_info(body, opts) + nil + end + + # Validate a monitor user template. + # + # Validate the structure and content of a monitor user template. + # + # @param body [MonitorUserTemplateCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def validate_monitor_user_template_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.validate_monitor_user_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.validate_monitor_user_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.validate_monitor_user_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: MonitorsAPI.validate_monitor_user_template ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling MonitorsAPI.validate_monitor_user_template" + end + # resource path + local_var_path = '/api/v2/monitor/template/validate' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :validate_monitor_user_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: MonitorsAPI#validate_monitor_user_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template.rb b/lib/datadog_api_client/v2/models/monitor_user_template.rb new file mode 100644 index 000000000000..f8ecaaebaf8f --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template.rb @@ -0,0 +1,200 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A monitor user template object. + class MonitorUserTemplate + include BaseGenericModel + + # The created timestamp of the template. + attr_accessor :created + + # A brief description of the monitor user template. + attr_accessor :description + + # The last modified timestamp. When the template version was created. + attr_accessor :modified + + # A valid monitor definition in the same format as the [V1 Monitor API](https://docs.datadoghq.com/api/latest/monitors/#create-a-monitor). + attr_accessor :monitor_definition + + # The definition of `MonitorUserTemplateTags` object. + attr_accessor :tags + + # The definition of `MonitorUserTemplateTemplateVariables` object. + attr_accessor :template_variables + + # The title of the monitor user template. + attr_accessor :title + + # The version of the monitor user template. + attr_accessor :version + + # All versions of the monitor user template. + attr_accessor :versions + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created' => :'created', + :'description' => :'description', + :'modified' => :'modified', + :'monitor_definition' => :'monitor_definition', + :'tags' => :'tags', + :'template_variables' => :'template_variables', + :'title' => :'title', + :'version' => :'version', + :'versions' => :'versions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created' => :'Time', + :'description' => :'String', + :'modified' => :'Time', + :'monitor_definition' => :'Hash', + :'tags' => :'Array', + :'template_variables' => :'Array', + :'title' => :'String', + :'version' => :'Integer', + :'versions' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'description', + :'version', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + end + + if attributes.key?(:'monitor_definition') + self.monitor_definition = attributes[:'monitor_definition'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.key?(:'versions') + if (value = attributes[:'versions']).is_a?(Array) + self.versions = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created == o.created && + description == o.description && + modified == o.modified && + monitor_definition == o.monitor_definition && + tags == o.tags && + template_variables == o.template_variables && + title == o.title && + version == o.version && + versions == o.versions && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created, description, modified, monitor_definition, tags, template_variables, title, version, versions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_create_data.rb b/lib/datadog_api_client/v2/models/monitor_user_template_create_data.rb new file mode 100644 index 000000000000..e6abe0556801 --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Monitor user template data. + class MonitorUserTemplateCreateData + include BaseGenericModel + + # Attributes for a monitor user template. + attr_reader :attributes + + # Monitor user template resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MonitorUserTemplateRequestAttributes', + :'type' => :'MonitorUserTemplateResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_create_request.rb b/lib/datadog_api_client/v2/models/monitor_user_template_create_request.rb new file mode 100644 index 000000000000..aa19cd698f99 --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for creating a monitor user template. + class MonitorUserTemplateCreateRequest + include BaseGenericModel + + # Monitor user template data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MonitorUserTemplateCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_create_response.rb b/lib/datadog_api_client/v2/models/monitor_user_template_create_response.rb new file mode 100644 index 000000000000..c42d53fb217a --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_create_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for creating a monitor user template. + class MonitorUserTemplateCreateResponse + include BaseGenericModel + + # Monitor user template list response data. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MonitorUserTemplateResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateCreateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_list_response.rb b/lib/datadog_api_client/v2/models/monitor_user_template_list_response.rb new file mode 100644 index 000000000000..37f8ffefc140 --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_list_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for retrieving all monitor user templates. + class MonitorUserTemplateListResponse + include BaseGenericModel + + # An array of monitor user templates. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_request_attributes.rb b/lib/datadog_api_client/v2/models/monitor_user_template_request_attributes.rb new file mode 100644 index 000000000000..86c86722ed7a --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_request_attributes.rb @@ -0,0 +1,172 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for a monitor user template. + class MonitorUserTemplateRequestAttributes + include BaseGenericModel + + # A brief description of the monitor user template. + attr_accessor :description + + # A valid monitor definition in the same format as the [V1 Monitor API](https://docs.datadoghq.com/api/latest/monitors/#create-a-monitor). + attr_reader :monitor_definition + + # The definition of `MonitorUserTemplateTags` object. + attr_reader :tags + + # The definition of `MonitorUserTemplateTemplateVariables` object. + attr_accessor :template_variables + + # The title of the monitor user template. + attr_reader :title + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'monitor_definition' => :'monitor_definition', + :'tags' => :'tags', + :'template_variables' => :'template_variables', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'monitor_definition' => :'Hash', + :'tags' => :'Array', + :'template_variables' => :'Array', + :'title' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'description', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateRequestAttributes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MonitorUserTemplateRequestAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'monitor_definition') + self.monitor_definition = attributes[:'monitor_definition'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @monitor_definition.nil? + return false if @tags.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param monitor_definition [Object] Object to be assigned + # @!visibility private + def monitor_definition=(monitor_definition) + if monitor_definition.nil? + fail ArgumentError, 'invalid value for "monitor_definition", monitor_definition cannot be nil.' + end + @monitor_definition = monitor_definition + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + @tags = tags + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + monitor_definition == o.monitor_definition && + tags == o.tags && + template_variables == o.template_variables && + title == o.title + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, monitor_definition, tags, template_variables, title].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_resource_type.rb b/lib/datadog_api_client/v2/models/monitor_user_template_resource_type.rb new file mode 100644 index 000000000000..39fb21b016a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Monitor user template resource type. + class MonitorUserTemplateResourceType + include BaseEnumModel + + MONITOR_USER_TEMPLATE = "monitor-user-template".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_response.rb b/lib/datadog_api_client/v2/models/monitor_user_template_response.rb new file mode 100644 index 000000000000..4ecc273037ae --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for retrieving a monitor user template. + class MonitorUserTemplateResponse + include BaseGenericModel + + # Monitor user template data. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MonitorUserTemplateResponseDataWithVersions' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_response_attributes.rb b/lib/datadog_api_client/v2/models/monitor_user_template_response_attributes.rb new file mode 100644 index 000000000000..f2e8c84ac4d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_response_attributes.rb @@ -0,0 +1,188 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for a monitor user template. + class MonitorUserTemplateResponseAttributes + include BaseGenericModel + + # The created timestamp of the template. + attr_accessor :created + + # A brief description of the monitor user template. + attr_accessor :description + + # The last modified timestamp. When the template version was created. + attr_accessor :modified + + # A valid monitor definition in the same format as the [V1 Monitor API](https://docs.datadoghq.com/api/latest/monitors/#create-a-monitor). + attr_accessor :monitor_definition + + # The definition of `MonitorUserTemplateTags` object. + attr_accessor :tags + + # The definition of `MonitorUserTemplateTemplateVariables` object. + attr_accessor :template_variables + + # The title of the monitor user template. + attr_accessor :title + + # The version of the monitor user template. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created' => :'created', + :'description' => :'description', + :'modified' => :'modified', + :'monitor_definition' => :'monitor_definition', + :'tags' => :'tags', + :'template_variables' => :'template_variables', + :'title' => :'title', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created' => :'Time', + :'description' => :'String', + :'modified' => :'Time', + :'monitor_definition' => :'Hash', + :'tags' => :'Array', + :'template_variables' => :'Array', + :'title' => :'String', + :'version' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'description', + :'version', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + end + + if attributes.key?(:'monitor_definition') + self.monitor_definition = attributes[:'monitor_definition'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created == o.created && + description == o.description && + modified == o.modified && + monitor_definition == o.monitor_definition && + tags == o.tags && + template_variables == o.template_variables && + title == o.title && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created, description, modified, monitor_definition, tags, template_variables, title, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_response_data.rb b/lib/datadog_api_client/v2/models/monitor_user_template_response_data.rb new file mode 100644 index 000000000000..3bd3687c246d --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Monitor user template list response data. + class MonitorUserTemplateResponseData + include BaseGenericModel + + # Attributes for a monitor user template. + attr_accessor :attributes + + # The unique identifier. + attr_accessor :id + + # Monitor user template resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MonitorUserTemplateResponseAttributes', + :'id' => :'String', + :'type' => :'MonitorUserTemplateResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_response_data_with_versions.rb b/lib/datadog_api_client/v2/models/monitor_user_template_response_data_with_versions.rb new file mode 100644 index 000000000000..c1068bf92fc7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_response_data_with_versions.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Monitor user template data. + class MonitorUserTemplateResponseDataWithVersions + include BaseGenericModel + + # A monitor user template object. + attr_accessor :attributes + + # The unique identifier. + attr_accessor :id + + # Monitor user template resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MonitorUserTemplate', + :'id' => :'String', + :'type' => :'MonitorUserTemplateResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateResponseDataWithVersions` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_template_variables_items.rb b/lib/datadog_api_client/v2/models/monitor_user_template_template_variables_items.rb new file mode 100644 index 000000000000..f6ea0d496e1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_template_variables_items.rb @@ -0,0 +1,132 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # List of objects representing template variables on the monitor which can have selectable values. + class MonitorUserTemplateTemplateVariablesItems + include BaseGenericModel + + # Available values for the variable. + attr_accessor :available_values + + # Default values of the template variable. + attr_accessor :defaults + + # The name of the template variable. + attr_reader :name + + # The tag key associated with the variable. This works the same as dashboard template variables. + attr_accessor :tag_key + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'available_values' => :'available_values', + :'defaults' => :'defaults', + :'name' => :'name', + :'tag_key' => :'tag_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'available_values' => :'Array', + :'defaults' => :'Array', + :'name' => :'String', + :'tag_key' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateTemplateVariablesItems` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::MonitorUserTemplateTemplateVariablesItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'available_values') + if (value = attributes[:'available_values']).is_a?(Array) + self.available_values = value + end + end + + if attributes.key?(:'defaults') + if (value = attributes[:'defaults']).is_a?(Array) + self.defaults = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tag_key') + self.tag_key = attributes[:'tag_key'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + available_values == o.available_values && + defaults == o.defaults && + name == o.name && + tag_key == o.tag_key + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [available_values, defaults, name, tag_key].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_update_data.rb b/lib/datadog_api_client/v2/models/monitor_user_template_update_data.rb new file mode 100644 index 000000000000..b39180bf1664 --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_update_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Monitor user template data. + class MonitorUserTemplateUpdateData + include BaseGenericModel + + # Attributes for a monitor user template. + attr_reader :attributes + + # The unique identifier. + attr_reader :id + + # Monitor user template resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MonitorUserTemplateRequestAttributes', + :'id' => :'String', + :'type' => :'MonitorUserTemplateResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/monitor_user_template_update_request.rb b/lib/datadog_api_client/v2/models/monitor_user_template_update_request.rb new file mode 100644 index 000000000000..9e43762c0dda --- /dev/null +++ b/lib/datadog_api_client/v2/models/monitor_user_template_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for creating a new monitor user template version. + class MonitorUserTemplateUpdateRequest + include BaseGenericModel + + # Monitor user template data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MonitorUserTemplateUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MonitorUserTemplateUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/simple_monitor_user_template.rb b/lib/datadog_api_client/v2/models/simple_monitor_user_template.rb new file mode 100644 index 000000000000..7f9106511abd --- /dev/null +++ b/lib/datadog_api_client/v2/models/simple_monitor_user_template.rb @@ -0,0 +1,188 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A simplified version of a monitor user template. + class SimpleMonitorUserTemplate + include BaseGenericModel + + # The created timestamp of the template. + attr_accessor :created + + # A brief description of the monitor user template. + attr_accessor :description + + # The unique identifier. The initial version will match the template ID. + attr_accessor :id + + # A valid monitor definition in the same format as the [V1 Monitor API](https://docs.datadoghq.com/api/latest/monitors/#create-a-monitor). + attr_accessor :monitor_definition + + # The definition of `MonitorUserTemplateTags` object. + attr_accessor :tags + + # The definition of `MonitorUserTemplateTemplateVariables` object. + attr_accessor :template_variables + + # The title of the monitor user template. + attr_accessor :title + + # The version of the monitor user template. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created' => :'created', + :'description' => :'description', + :'id' => :'id', + :'monitor_definition' => :'monitor_definition', + :'tags' => :'tags', + :'template_variables' => :'template_variables', + :'title' => :'title', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created' => :'Time', + :'description' => :'String', + :'id' => :'String', + :'monitor_definition' => :'Hash', + :'tags' => :'Array', + :'template_variables' => :'Array', + :'title' => :'String', + :'version' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'description', + :'version', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SimpleMonitorUserTemplate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'monitor_definition') + self.monitor_definition = attributes[:'monitor_definition'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created == o.created && + description == o.description && + id == o.id && + monitor_definition == o.monitor_definition && + tags == o.tags && + template_variables == o.template_variables && + title == o.title && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created, description, id, monitor_definition, tags, template_variables, title, version, additional_properties].hash + end + end +end