From 32e2668e210244506d163ab2fb2c095ed73b5688 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 9 Oct 2024 19:21:38 +0000 Subject: [PATCH] Regenerate client from commit 5366e690 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 243 ++++++++++++++++++ ...w-dashboard-with-alert-graph-widget.frozen | 2 +- ...-new-dashboard-with-alert-graph-widget.yml | 35 +-- ...w-dashboard-with-alert-value-widget.frozen | 2 +- ...-new-dashboard-with-alert-value-widget.yml | 35 +-- ...onitor-downtime-returns-OK-response.frozen | 2 +- ...a-monitor-downtime-returns-OK-response.yml | 33 +-- ...-can-be-deleted-returns-OK-response.frozen | 2 +- ...tor-can-be-deleted-returns-OK-response.yml | 28 +- ...elete-a-monitor-returns-OK-response.frozen | 2 +- .../Delete-a-monitor-returns-OK-response.yml | 26 +- .../Edit-a-monitor-returns-OK-response.frozen | 2 +- .../Edit-a-monitor-returns-OK-response.yml | 34 +-- ...nitor-s-details-returns-OK-response.frozen | 2 +- ...-monitor-s-details-returns-OK-response.yml | 34 +-- ...nitor-returns-Invalid-JSON-response.frozen | 2 +- ...-monitor-returns-Invalid-JSON-response.yml | 26 +- ...xisting-monitor-returns-OK-response.frozen | 2 +- ...n-existing-monitor-returns-OK-response.yml | 30 +-- examples/v2/events/CreateEvent.rb | 42 +++ features/scenarios_model_mapping.rb | 3 + features/v1/given.json | 2 +- features/v2/events.feature | 29 ++- features/v2/undo.json | 6 + lib/datadog_api_client/inflector.rb | 15 ++ lib/datadog_api_client/v2/api/events_api.rb | 67 +++++ .../v2/models/change_event.rb | 237 +++++++++++++++++ .../v2/models/change_event_category.rb | 26 ++ .../v2/models/change_event_create_request.rb | 115 +++++++++ .../change_event_create_request_type.rb | 26 ++ .../v2/models/change_event_create_response.rb | 115 +++++++++ ...change_event_create_response_attributes.rb | 105 ++++++++ ...t_create_response_attributes_attributes.rb | 105 ++++++++ ...eate_response_attributes_attributes_evt.rb | 105 ++++++++ .../models/change_event_custom_attributes.rb | 176 +++++++++++++ .../change_event_custom_attributes_author.rb | 148 +++++++++++ ...nge_event_custom_attributes_author_type.rb | 27 ++ ...vent_custom_attributes_changed_resource.rb | 144 +++++++++++ ...custom_attributes_changed_resource_type.rb | 26 ++ ...tom_attributes_impacted_resources_items.rb | 144 +++++++++++ ...ttributes_impacted_resources_items_type.rb | 26 ++ 42 files changed, 2078 insertions(+), 161 deletions(-) create mode 100644 examples/v2/events/CreateEvent.rb create mode 100644 lib/datadog_api_client/v2/models/change_event.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_category.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_create_request_type.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_create_response.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_create_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_create_response_attributes_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_create_response_attributes_attributes_evt.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_custom_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_custom_attributes_author.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_custom_attributes_author_type.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items_type.rb diff --git a/.apigentools-info b/.apigentools-info index b21208bc3a3..b4e2bf0c6ac 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-09 15:02:58.401855", - "spec_repo_commit": "43ae024c" + "regenerated": "2024-10-09 19:21:13.279536", + "spec_repo_commit": "5366e690" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-09 15:02:58.419941", - "spec_repo_commit": "43ae024c" + "regenerated": "2024-10-09 19:21:13.297944", + "spec_repo_commit": "5366e690" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3ee9a258d25..3f7b5cd1270 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3951,6 +3951,223 @@ components: format: int64 type: integer type: object + ChangeEvent: + description: Object representing a change event. + properties: + aggregation_key: + description: 'An arbitrary string to use for aggregation. Limited to 100 + characters. + + If you specify a key, all events using that key are grouped together in + the Event Stream.' + maxLength: 100 + type: string + attributes: + $ref: '#/components/schemas/ChangeEventCustomAttributes' + category: + $ref: '#/components/schemas/ChangeEventCategory' + message: + description: The body of the event. Limited to 4000 characters. + example: payment_processed feature flag has been enabled + maxLength: 4000 + type: string + tags: + description: 'A list of tags to apply to the event. + + Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).' + example: + - environment:test + items: + description: A tag. + type: string + type: array + timestamp: + description: 'Timestamp in which the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) + format. + + For example `"2017-01-15T01:30:15.010000Z"`. + + Defaults to now. Limited to values no older than 18 hours.' + type: string + title: + description: The event title. Limited to 500 characters. + example: payment_processed feature flag updated + maxLength: 500 + type: string + required: + - title + - category + - attributes + type: object + ChangeEventCategory: + description: Event category to identify the type of event. Only the value `change` + is supported. + enum: + - change + example: change + type: string + x-enum-varnames: + - CHANGE + ChangeEventCreateRequest: + description: Object representing an event. + properties: + attributes: + $ref: '#/components/schemas/ChangeEvent' + type: + $ref: '#/components/schemas/ChangeEventCreateRequestType' + type: object + ChangeEventCreateRequestType: + description: Entity type. + enum: + - event + type: string + x-enum-varnames: + - EVENT + ChangeEventCreateResponse: + description: Object containing an event response. + properties: + attributes: + $ref: '#/components/schemas/ChangeEventCreateResponseAttributes' + type: + description: Event type + type: string + type: object + ChangeEventCreateResponseAttributes: + description: The definition of `ChangeEventCreateResponseAttributes` object. + properties: + attributes: + $ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributes' + type: object + ChangeEventCreateResponseAttributesAttributes: + description: The definition of `ChangeEventCreateResponseAttributesAttributes` + object. + properties: + evt: + $ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributesEvt' + type: object + ChangeEventCreateResponseAttributesAttributesEvt: + description: The definition of `ChangeEventCreateResponseAttributesAttributesEvt` + object. + properties: + id: + description: Event id + type: string + type: object + ChangeEventCustomAttributes: + description: Object representing custom event attributes. + properties: + author: + $ref: '#/components/schemas/ChangeEventCustomAttributesAuthor' + change_metadata: + description: Free form object with any related information of the `change` + event. + example: + resource_link: /feature/fallback_payments_test + user: + email: dd_user_email + name: dd_user + type: object + changed_resource: + $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResource' + impacted_resources: + description: 'A list of resources impacted by this change. At least one + resource is required. Only resources + + of type `service` are supported.' + example: + - name: payments_api + type: service + items: + $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems' + type: array + new_value: + description: Free form object to track new value of the changed resource. + example: + enabled: true + percentage: 50% + rule: + datacenter: us1.prod + type: object + prev_value: + description: Free form object to track previous value of the changed resource. + example: + enabled: true + percentage: 10% + rule: + datacenter: us1.prod + type: object + required: + - changed_resource + type: object + ChangeEventCustomAttributesAuthor: + description: Object representing the entity which made the change. Optional + field but if provided should include `type` and `name`. + properties: + name: + description: Author's name. Limited to 128 characters. + example: '' + maxLength: 128.0 + type: string + type: + $ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType' + required: + - name + - type + type: object + ChangeEventCustomAttributesAuthorType: + description: Author's type. + enum: + - user + - system + example: user + type: string + x-enum-varnames: + - USER + - SYSTEM + ChangeEventCustomAttributesChangedResource: + description: Object representing a uniquely identified resource. Only the resource + type `feature_flag` is supported. + properties: + name: + description: Resource's name. + example: fallback_payments_test + type: string + type: + $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType' + required: + - type + - name + type: object + ChangeEventCustomAttributesChangedResourceType: + description: Resource's type. + enum: + - feature_flag + example: feature_flag + type: string + x-enum-varnames: + - FEATURE_FLAG + ChangeEventCustomAttributesImpactedResourcesItems: + description: Object representing a uniquely identified resource. Only the resource + type `service` is supported. + properties: + name: + description: Resource's name. + example: payments_api + type: string + type: + $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType' + required: + - type + - name + type: object + ChangeEventCustomAttributesImpactedResourcesItemsType: + description: Resource's type. + enum: + - service + example: service + type: string + x-enum-varnames: + - SERVICE ChargebackBreakdown: description: Charges breakdown. properties: @@ -29664,6 +29881,32 @@ paths: operator: OR permissions: - events_read + post: + description: This endpoint allows you to post events. Only events with `change` + category are supported. + operationId: CreateEvent + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeEventCreateRequest' + description: Event request object + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeEventCreateResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + summary: Post a change event + tags: + - Events + x-codegen-request-body-name: body /api/v2/events/search: post: description: 'List endpoint returns events that match an events search query. diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.frozen index ea1f2ccb9fb..080276c3f11 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.frozen +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.frozen @@ -1 +1 @@ -2023-01-18T18:37:16.146Z \ No newline at end of file +2024-10-09T19:10:45.007Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.yml index c877cbd0c63..0050ea54e3c 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.yml +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-graph-widget.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Wed, 18 Jan 2023 18:37:16 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:45 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Create_a_new_dashboard_with_alert_graph_widget-1674067036","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Create_a_new_dashboard_with_alert_graph_widget-1728501045","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testcreateanewdashboardwithalertgraphwidget1674067036","env:ci"],"type":"log + > 2","tags":["test:testcreateanewdashboardwithalertgraphwidget1728501045","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":108260299,"org_id":321813,"type":"log alert","name":"Test-Create_a_new_dashboard_with_alert_graph_widget-1674067036","message":"some - message Notify: @hipchat-channel","tags":["test:testcreateanewdashboardwithalertgraphwidget1674067036","env:ci"],"query":"logs(\"service:foo + string: '{"id":155777972,"org_id":321813,"type":"log alert","name":"Test-Create_a_new_dashboard_with_alert_graph_widget-1728501045","message":"some + message Notify: @hipchat-channel","tags":["test:testcreateanewdashboardwithalertgraphwidget1728501045","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1674067036000,"created":"2023-01-18T18:37:16.358564+00:00","modified":"2023-01-18T18:37:16.358564+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501045000,"created":"2024-10-09T19:10:45.471411+00:00","modified":"2024-10-09T19:10:45.471411+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,11 +32,11 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:16 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:45 GMT request: body: encoding: UTF-8 - string: '{"description":"","is_read_only":false,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_alert_graph_widget-1674067036","widgets":[{"definition":{"alert_id":"108260299","time":{},"title":"","title_align":"left","title_size":"16","type":"alert_graph","viz_type":"timeseries"},"layout":{"height":15,"width":47,"x":0,"y":0}}]}' + string: '{"description":"","is_read_only":false,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_alert_graph_widget-1728501045","widgets":[{"definition":{"alert_id":"155777972","time":{},"title":"","title_align":"left","title_size":"16","type":"alert_graph","viz_type":"timeseries"},"layout":{"height":15,"width":47,"x":0,"y":0}}]}' headers: Accept: - application/json @@ -47,7 +47,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"notify_list":[],"description":"","restricted_roles":[],"author_name":null,"template_variables":[],"is_read_only":false,"id":"tvp-85z-v2d","title":"Test-Create_a_new_dashboard_with_alert_graph_widget-1674067036","url":"/dashboard/tvp-85z-v2d/test-createanewdashboardwithalertgraphwidget-1674067036","created_at":"2023-01-18T18:37:16.495648+00:00","modified_at":"2023-01-18T18:37:16.495648+00:00","author_handle":"frog@datadoghq.com","widgets":[{"definition":{"title_size":"16","viz_type":"timeseries","title":"","title_align":"left","alert_id":"108260299","time":{},"type":"alert_graph"},"layout":{"y":0,"width":47,"x":0,"height":15},"id":236119153104762}],"layout_type":"free"} + string: '{"id":"dma-bi2-bfq","title":"Test-Create_a_new_dashboard_with_alert_graph_widget-1728501045","description":"","author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"free","url":"/dashboard/dma-bi2-bfq/test-createanewdashboardwithalertgraphwidget-1728501045","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"alert_id":"155777972","time":{},"title":"","title_align":"left","title_size":"16","type":"alert_graph","viz_type":"timeseries"},"layout":{"height":15,"width":47,"x":0,"y":0},"id":5577570364164388}],"notify_list":[],"created_at":"2024-10-09T19:10:45.933616+00:00","modified_at":"2024-10-09T19:10:45.933616+00:00","restricted_roles":[]} ' headers: @@ -56,18 +57,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:16 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:45 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/tvp-85z-v2d + uri: https://api.datadoghq.com/api/v1/dashboard/dma-bi2-bfq response: body: encoding: UTF-8 - string: '{"deleted_dashboard_id":"tvp-85z-v2d"} + string: '{"deleted_dashboard_id":"dma-bi2-bfq"} ' headers: @@ -76,18 +77,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:16 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:45 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/108260299 + uri: https://api.datadoghq.com/api/v1/monitor/155777972 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":108260299} + string: '{"deleted_monitor_id":155777972} ' headers: diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.frozen index 80f12ae0484..7074fd03d6e 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.frozen +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.frozen @@ -1 +1 @@ -2023-01-18T18:37:16.878Z \ No newline at end of file +2024-10-09T19:10:46.917Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.yml index e882e0dc7cd..396ba9cac75 100644 --- a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.yml +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-alert-value-widget.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Wed, 18 Jan 2023 18:37:16 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:46 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Create_a_new_dashboard_with_alert_value_widget-1674067036","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Create_a_new_dashboard_with_alert_value_widget-1728501046","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testcreateanewdashboardwithalertvaluewidget1674067036","env:ci"],"type":"log + > 2","tags":["test:testcreateanewdashboardwithalertvaluewidget1728501046","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":108260300,"org_id":321813,"type":"log alert","name":"Test-Create_a_new_dashboard_with_alert_value_widget-1674067036","message":"some - message Notify: @hipchat-channel","tags":["test:testcreateanewdashboardwithalertvaluewidget1674067036","env:ci"],"query":"logs(\"service:foo + string: '{"id":155777973,"org_id":321813,"type":"log alert","name":"Test-Create_a_new_dashboard_with_alert_value_widget-1728501046","message":"some + message Notify: @hipchat-channel","tags":["test:testcreateanewdashboardwithalertvaluewidget1728501046","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1674067037000,"created":"2023-01-18T18:37:17.013180+00:00","modified":"2023-01-18T18:37:17.013180+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501047000,"created":"2024-10-09T19:10:47.294819+00:00","modified":"2024-10-09T19:10:47.294819+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,11 +32,11 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:16 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:46 GMT request: body: encoding: UTF-8 - string: '{"description":"","is_read_only":false,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_alert_value_widget-1674067036","widgets":[{"definition":{"alert_id":"108260300","precision":2,"text_align":"left","title":"","title_align":"left","title_size":"16","type":"alert_value","unit":"auto"},"layout":{"height":8,"width":15,"x":0,"y":0}}]}' + string: '{"description":"","is_read_only":false,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_alert_value_widget-1728501046","widgets":[{"definition":{"alert_id":"155777973","precision":2,"text_align":"left","title":"","title_align":"left","title_size":"16","type":"alert_value","unit":"auto"},"layout":{"height":8,"width":15,"x":0,"y":0}}]}' headers: Accept: - application/json @@ -47,7 +47,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"notify_list":[],"description":"","restricted_roles":[],"author_name":null,"template_variables":[],"is_read_only":false,"id":"ess-8yc-y8y","title":"Test-Create_a_new_dashboard_with_alert_value_widget-1674067036","url":"/dashboard/ess-8yc-y8y/test-createanewdashboardwithalertvaluewidget-1674067036","created_at":"2023-01-18T18:37:17.145823+00:00","modified_at":"2023-01-18T18:37:17.145823+00:00","author_handle":"frog@datadoghq.com","widgets":[{"definition":{"title_size":"16","title":"","title_align":"left","text_align":"left","precision":2,"alert_id":"108260300","type":"alert_value","unit":"auto"},"layout":{"y":0,"width":15,"x":0,"height":8},"id":3516493079797108}],"layout_type":"free"} + string: '{"id":"jfs-i5n-8pc","title":"Test-Create_a_new_dashboard_with_alert_value_widget-1728501046","description":"","author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"free","url":"/dashboard/jfs-i5n-8pc/test-createanewdashboardwithalertvaluewidget-1728501046","is_read_only":false,"template_variables":[],"widgets":[{"definition":{"alert_id":"155777973","precision":2,"text_align":"left","title":"","title_align":"left","title_size":"16","type":"alert_value","unit":"auto"},"layout":{"height":8,"width":15,"x":0,"y":0},"id":4308194848648575}],"notify_list":[],"created_at":"2024-10-09T19:10:47.712161+00:00","modified_at":"2024-10-09T19:10:47.712161+00:00","restricted_roles":[]} ' headers: @@ -56,18 +57,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:16 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:46 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/dashboard/ess-8yc-y8y + uri: https://api.datadoghq.com/api/v1/dashboard/jfs-i5n-8pc response: body: encoding: UTF-8 - string: '{"deleted_dashboard_id":"ess-8yc-y8y"} + string: '{"deleted_dashboard_id":"jfs-i5n-8pc"} ' headers: @@ -76,18 +77,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:16 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:46 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/108260300 + uri: https://api.datadoghq.com/api/v1/monitor/155777973 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":108260300} + string: '{"deleted_monitor_id":155777973} ' headers: diff --git a/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.frozen b/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.frozen index 53b28bc7837..4b2e0f4a4d5 100644 --- a/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.frozen +++ b/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.frozen @@ -1 +1 @@ -2023-01-18T18:37:17.507Z \ No newline at end of file +2024-10-09T19:10:48.738Z \ No newline at end of file diff --git a/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.yml b/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.yml index 1144f796344..41807b499e8 100644 --- a/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.yml +++ b/cassettes/features/v1/downtimes/Schedule-a-monitor-downtime-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Wed, 18 Jan 2023 18:37:17 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:48 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Schedule_a_monitor_downtime_returns_OK_response-1674067037","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Schedule_a_monitor_downtime_returns_OK_response-1728501048","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testscheduleamonitordowntimereturnsokresponse1674067037","env:ci"],"type":"log + > 2","tags":["test:testscheduleamonitordowntimereturnsokresponse1728501048","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":108260301,"org_id":321813,"type":"log alert","name":"Test-Schedule_a_monitor_downtime_returns_OK_response-1674067037","message":"some - message Notify: @hipchat-channel","tags":["test:testscheduleamonitordowntimereturnsokresponse1674067037","env:ci"],"query":"logs(\"service:foo + string: '{"id":155777976,"org_id":321813,"type":"log alert","name":"Test-Schedule_a_monitor_downtime_returns_OK_response-1728501048","message":"some + message Notify: @hipchat-channel","tags":["test:testscheduleamonitordowntimereturnsokresponse1728501048","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1674067037000,"created":"2023-01-18T18:37:17.701290+00:00","modified":"2023-01-18T18:37:17.701290+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501049000,"created":"2024-10-09T19:10:49.823767+00:00","modified":"2024-10-09T19:10:49.823767+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,11 +32,11 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:17 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:48 GMT request: body: encoding: UTF-8 - string: '{"message":"Test-Schedule_a_monitor_downtime_returns_OK_response-1674067037","monitor_id":108260301,"scope":["test:testscheduleamonitordowntimereturnsokresponse1674067037"],"start":1674067037,"timezone":"Etc/UTC"}' + string: '{"message":"Test-Schedule_a_monitor_downtime_returns_OK_response-1728501048","monitor_id":155777976,"scope":["test:testscheduleamonitordowntimereturnsokresponse1728501048"],"start":1728501048,"timezone":"Etc/UTC"}' headers: Accept: - application/json @@ -47,7 +47,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":2598558218,"monitor_id":108260301,"org_id":321813,"start":1674067037,"end":null,"canceled":null,"created":1674067037,"modified":1674067037,"message":"Test-Schedule_a_monitor_downtime_returns_OK_response-1674067037","active":true,"disabled":false,"recurrence":null,"timezone":"Etc/UTC","parent_id":null,"child_id":null,"creator_id":1445416,"updater_id":null,"downtime_type":2,"monitor_tags":["*"],"mute_first_recovery_notification":false,"scope":["test:testscheduleamonitordowntimereturnsokresponse1674067037"]} + string: '{"id":4428559092,"monitor_id":155777976,"org_id":321813,"start":1728501048,"end":null,"canceled":null,"created":1728501050,"modified":1728501050,"message":"Test-Schedule_a_monitor_downtime_returns_OK_response-1728501048","active":true,"disabled":false,"recurrence":null,"timezone":"Etc/UTC","parent_id":null,"child_id":null,"creator_id":2320499,"updater_id":null,"downtime_type":2,"status":"active","monitor_tags":["*"],"mute_first_recovery_notification":false,"notify_end_types":["expired"],"notify_end_states":["alert","no + data","warn"],"uuid":"3c71a4ea-c643-4321-977b-854c7014643d","scope":["test:testscheduleamonitordowntimereturnsokresponse1728501048"]} ' headers: @@ -56,14 +57,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:17 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:48 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v1/downtime/2598558218 + uri: https://api.datadoghq.com/api/v1/downtime/4428559092 response: body: encoding: UTF-8 @@ -74,18 +75,18 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Wed, 18 Jan 2023 18:37:17 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:48 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/108260301 + uri: https://api.datadoghq.com/api/v1/monitor/155777976 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":108260301} + string: '{"deleted_monitor_id":155777976} ' headers: diff --git a/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.frozen b/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.frozen index bdefbfef17b..d059f246ffb 100644 --- a/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.frozen @@ -1 +1 @@ -2023-01-18T18:37:18.314Z \ No newline at end of file +2024-10-09T19:10:51.425Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml b/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml index be4886a122b..ddb52222f07 100644 --- a/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Check-if-a-monitor-can-be-deleted-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Wed, 18 Jan 2023 18:37:18 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:51 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Check_if_a_monitor_can_be_deleted_returns_OK_response-1674067038","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Check_if_a_monitor_can_be_deleted_returns_OK_response-1728501051","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testcheckifamonitorcanbedeletedreturnsokresponse1674067038","env:ci"],"type":"log + > 2","tags":["test:testcheckifamonitorcanbedeletedreturnsokresponse1728501051","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":108260302,"org_id":321813,"type":"log alert","name":"Test-Check_if_a_monitor_can_be_deleted_returns_OK_response-1674067038","message":"some - message Notify: @hipchat-channel","tags":["test:testcheckifamonitorcanbedeletedreturnsokresponse1674067038","env:ci"],"query":"logs(\"service:foo + string: '{"id":155777984,"org_id":321813,"type":"log alert","name":"Test-Check_if_a_monitor_can_be_deleted_returns_OK_response-1728501051","message":"some + message Notify: @hipchat-channel","tags":["test:testcheckifamonitorcanbedeletedreturnsokresponse1728501051","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1674067038000,"created":"2023-01-18T18:37:18.431658+00:00","modified":"2023-01-18T18:37:18.431658+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501051000,"created":"2024-10-09T19:10:51.782687+00:00","modified":"2024-10-09T19:10:51.782687+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,18 +32,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:18 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:51 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v1/monitor/can_delete?monitor_ids=108260302 + uri: https://api.datadoghq.com/api/v1/monitor/can_delete?monitor_ids=155777984 response: body: encoding: UTF-8 - string: '{"data":{"ok":[108260302]},"errors":null} + string: '{"data":{"ok":[155777984]},"errors":null} ' headers: @@ -52,18 +52,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:18 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:51 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/108260302 + uri: https://api.datadoghq.com/api/v1/monitor/155777984 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":108260302} + string: '{"deleted_monitor_id":155777984} ' headers: diff --git a/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.frozen index 06daabc8188..a89f3003af0 100644 --- a/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.frozen @@ -1 +1 @@ -2023-01-18T18:37:18.880Z \ No newline at end of file +2024-10-09T19:10:52.647Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.yml index d9236d36e87..8af846977d7 100644 --- a/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Delete-a-monitor-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Wed, 18 Jan 2023 18:37:18 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:52 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Delete_a_monitor_returns_OK_response-1674067038","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Delete_a_monitor_returns_OK_response-1728501052","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testdeleteamonitorreturnsokresponse1674067038","env:ci"],"type":"log + > 2","tags":["test:testdeleteamonitorreturnsokresponse1728501052","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":108260303,"org_id":321813,"type":"log alert","name":"Test-Delete_a_monitor_returns_OK_response-1674067038","message":"some - message Notify: @hipchat-channel","tags":["test:testdeleteamonitorreturnsokresponse1674067038","env:ci"],"query":"logs(\"service:foo + string: '{"id":155777995,"org_id":321813,"type":"log alert","name":"Test-Delete_a_monitor_returns_OK_response-1728501052","message":"some + message Notify: @hipchat-channel","tags":["test:testdeleteamonitorreturnsokresponse1728501052","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1674067039000,"created":"2023-01-18T18:37:19.000343+00:00","modified":"2023-01-18T18:37:19.000343+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501053000,"created":"2024-10-09T19:10:53.021211+00:00","modified":"2024-10-09T19:10:53.021211+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,18 +32,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:18 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:52 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/108260303 + uri: https://api.datadoghq.com/api/v1/monitor/155777995 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":108260303} + string: '{"deleted_monitor_id":155777995} ' headers: @@ -52,14 +52,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:18 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:52 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/108260303 + uri: https://api.datadoghq.com/api/v1/monitor/155777995 response: body: encoding: UTF-8 diff --git a/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.frozen index 981d358e3a1..b83f5dae867 100644 --- a/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.frozen @@ -1 +1 @@ -2024-06-20T19:37:04.361Z \ No newline at end of file +2024-10-09T19:10:53.885Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml index a719bb55c1d..b1f64d5a533 100644 --- a/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Edit-a-monitor-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Thu, 20 Jun 2024 19:37:04 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:53 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Edit_a_monitor_returns_OK_response-1718912224","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Edit_a_monitor_returns_OK_response-1728501053","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testeditamonitorreturnsokresponse1718912224","env:ci"],"type":"log + > 2","tags":["test:testeditamonitorreturnsokresponse1728501053","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":147580793,"org_id":237503,"type":"log alert","name":"Test-Edit_a_monitor_returns_OK_response-1718912224","message":"some - message Notify: @hipchat-channel","tags":["test:testeditamonitorreturnsokresponse1718912224","env:ci"],"query":"logs(\"service:foo + string: '{"id":155778004,"org_id":321813,"type":"log alert","name":"Test-Edit_a_monitor_returns_OK_response-1728501053","message":"some + message Notify: @hipchat-channel","tags":["test:testeditamonitorreturnsokresponse1728501053","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1718912224000,"created":"2024-06-20T19:37:04.686145+00:00","modified":"2024-06-20T19:37:04.686145+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":"Carl Martensen","handle":"carl.martensen@datadoghq.com","email":"carl.martensen@datadoghq.com","id":1078685}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501054000,"created":"2024-10-09T19:10:54.256878+00:00","modified":"2024-10-09T19:10:54.256878+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,25 +32,25 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 20 Jun 2024 19:37:04 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:53 GMT request: body: encoding: UTF-8 - string: '{"name":"Test-Edit_a_monitor_returns_OK_response-1718912224-updated","options":{"evaluation_delay":null,"new_group_delay":600,"new_host_delay":null,"renotify_interval":null,"thresholds":{"critical":2,"warning":null},"timeout_h":null},"priority":null}' + string: '{"name":"Test-Edit_a_monitor_returns_OK_response-1728501053-updated","options":{"evaluation_delay":null,"new_group_delay":600,"new_host_delay":null,"renotify_interval":null,"thresholds":{"critical":2,"warning":null},"timeout_h":null},"priority":null}' headers: Accept: - application/json Content-Type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v1/monitor/147580793 + uri: https://api.datadoghq.com/api/v1/monitor/155778004 response: body: encoding: UTF-8 - string: '{"id":147580793,"org_id":237503,"type":"log alert","name":"Test-Edit_a_monitor_returns_OK_response-1718912224-updated","message":"some - message Notify: @hipchat-channel","tags":["test:testeditamonitorreturnsokresponse1718912224","env:ci"],"query":"logs(\"service:foo + string: '{"id":155778004,"org_id":321813,"type":"log alert","name":"Test-Edit_a_monitor_returns_OK_response-1728501053-updated","message":"some + message Notify: @hipchat-channel","tags":["test:testeditamonitorreturnsokresponse1728501053","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","options":{"evaluation_delay":null,"new_group_delay":600,"new_host_delay":null,"renotify_interval":null,"thresholds":{"critical":2.0},"timeout_h":null,"notify_no_data":false,"notify_audit":false,"include_tags":true,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1718912224000,"created":"2024-06-20T19:37:04.686145+00:00","modified":"2024-06-20T19:37:05.129654+00:00","deleted":null,"restricted_roles":null,"priority":null,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + > 2","options":{"evaluation_delay":null,"new_group_delay":600,"new_host_delay":null,"renotify_interval":null,"thresholds":{"critical":2.0},"timeout_h":null,"notify_no_data":false,"notify_audit":false,"include_tags":true,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501054000,"created":"2024-10-09T19:10:54.256878+00:00","modified":"2024-10-09T19:10:54.740903+00:00","deleted":null,"restricted_roles":null,"priority":null,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No Data"} ' @@ -60,18 +60,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 20 Jun 2024 19:37:04 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:53 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/147580793 + uri: https://api.datadoghq.com/api/v1/monitor/155778004 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":147580793} + string: '{"deleted_monitor_id":155778004} ' headers: diff --git a/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.frozen b/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.frozen index ec45a2b566b..039b1cf8ffe 100644 --- a/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.frozen @@ -1 +1 @@ -2023-05-22T17:02:26.784Z \ No newline at end of file +2024-10-09T19:10:55.263Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.yml b/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.yml index e8776470cbd..7c6b44e8a93 100644 --- a/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Get-a-monitor-s-details-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Mon, 22 May 2023 17:02:26 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:55 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Get_a_monitor_s_details_returns_OK_response-1684774946","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Get_a_monitor_s_details_returns_OK_response-1728501055","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testgetamonitorsdetailsreturnsokresponse1684774946","env:ci"],"type":"log + > 2","tags":["test:testgetamonitorsdetailsreturnsokresponse1728501055","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":119735290,"org_id":321813,"type":"log alert","name":"Test-Get_a_monitor_s_details_returns_OK_response-1684774946","message":"some - message Notify: @hipchat-channel","tags":["test:testgetamonitorsdetailsreturnsokresponse1684774946","env:ci"],"query":"logs(\"service:foo + string: '{"id":155778013,"org_id":321813,"type":"log alert","name":"Test-Get_a_monitor_s_details_returns_OK_response-1728501055","message":"some + message Notify: @hipchat-channel","tags":["test:testgetamonitorsdetailsreturnsokresponse1728501055","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1684774946000,"created":"2023-05-22T17:02:26.996650+00:00","modified":"2023-05-22T17:02:26.996650+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501055000,"created":"2024-10-09T19:10:55.618391+00:00","modified":"2024-10-09T19:10:55.618391+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,23 +32,23 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Mon, 22 May 2023 17:02:26 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:55 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v1/monitor/119735290?with_downtimes=true + uri: https://api.datadoghq.com/api/v1/monitor/155778013?with_downtimes=true response: body: encoding: UTF-8 - string: '{"id":119735290,"org_id":321813,"type":"log alert","name":"Test-Get_a_monitor_s_details_returns_OK_response-1684774946","message":"some - message Notify: @hipchat-channel","tags":["test:testgetamonitorsdetailsreturnsokresponse1684774946","env:ci"],"query":"logs(\"service:foo + string: '{"id":155778013,"org_id":321813,"type":"log alert","name":"Test-Get_a_monitor_s_details_returns_OK_response-1728501055","message":"some + message Notify: @hipchat-channel","tags":["test:testgetamonitorsdetailsreturnsokresponse1728501055","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1684774946000,"created":"2023-05-22T17:02:26.996650+00:00","modified":"2023-05-22T17:02:26.996650+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416},"matching_downtimes":[]} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501055000,"created":"2024-10-09T19:10:55.618391+00:00","modified":"2024-10-09T19:10:55.618391+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","id":2320499},"matching_downtimes":[]} ' headers: @@ -57,18 +57,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Mon, 22 May 2023 17:02:26 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:55 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/119735290 + uri: https://api.datadoghq.com/api/v1/monitor/155778013 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":119735290} + string: '{"deleted_monitor_id":155778013} ' headers: diff --git a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.frozen b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.frozen index c29a2d2e979..fad94217955 100644 --- a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.frozen +++ b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.frozen @@ -1 +1 @@ -2023-01-18T18:37:20.085Z \ No newline at end of file +2024-10-09T19:10:56.540Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.yml b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.yml index c7eb1518252..ceccdaad021 100644 --- a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.yml +++ b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-Invalid-JSON-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Wed, 18 Jan 2023 18:37:20 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:56 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1674067040","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1728501056","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1674067040","env:ci"],"type":"log + > 2","tags":["test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1728501056","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":108260306,"org_id":321813,"type":"log alert","name":"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1674067040","message":"some - message Notify: @hipchat-channel","tags":["test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1674067040","env:ci"],"query":"logs(\"service:foo + string: '{"id":155778018,"org_id":321813,"type":"log alert","name":"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1728501056","message":"some + message Notify: @hipchat-channel","tags":["test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1728501056","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1674067040000,"created":"2023-01-18T18:37:20.200427+00:00","modified":"2023-01-18T18:37:20.200427+00:00","deleted":null,"restricted_roles":null,"priority":3,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com","id":1445416}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501056000,"created":"2024-10-09T19:10:56.932037+00:00","modified":"2024-10-09T19:10:56.932037+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,7 +32,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 18 Jan 2023 18:37:20 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:56 GMT request: body: encoding: UTF-8 @@ -43,7 +43,7 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v1/monitor/108260306/validate + uri: https://api.datadoghq.com/api/v1/monitor/155778018/validate response: body: encoding: UTF-8 @@ -55,18 +55,18 @@ http_interactions: status: code: 400 message: Bad Request -- recorded_at: Wed, 18 Jan 2023 18:37:20 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:56 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/108260306 + uri: https://api.datadoghq.com/api/v1/monitor/155778018 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":108260306} + string: '{"deleted_monitor_id":155778018} ' headers: diff --git a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.frozen b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.frozen index dc14445dd32..3874e1de2c9 100644 --- a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.frozen +++ b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.frozen @@ -1 +1 @@ -2024-10-09T14:54:55.436Z \ No newline at end of file +2024-10-09T19:10:57.822Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.yml b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.yml index ce03b66260e..a112f4cad85 100644 --- a/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.yml +++ b/cassettes/features/v1/monitors/Validate-an-existing-monitor-returns-OK-response.yml @@ -1,12 +1,12 @@ http_interactions: -- recorded_at: Wed, 09 Oct 2024 14:54:55 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:57 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_an_existing_monitor_returns_OK_response-1728485695","options":{"enable_logs_sample":true,"escalation_message":"the - situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_an_existing_monitor_returns_OK_response-1728501057","options":{"enable_logs_sample":true,"escalation_message":"the + situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testvalidateanexistingmonitorreturnsokresponse1728485695","env:ci"],"type":"log + > 2","tags":["test:testvalidateanexistingmonitorreturnsokresponse1728501057","env:ci"],"type":"log alert"}' headers: Accept: @@ -18,12 +18,12 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"id":155758542,"org_id":321813,"type":"log alert","name":"Test-Validate_an_existing_monitor_returns_OK_response-1728485695","message":"some - message Notify: @hipchat-channel","tags":["test:testvalidateanexistingmonitorreturnsokresponse1728485695","env:ci"],"query":"logs(\"service:foo + string: '{"id":155778021,"org_id":321813,"type":"log alert","name":"Test-Validate_an_existing_monitor_returns_OK_response-1728501057","message":"some + message Notify: @hipchat-channel","tags":["test:testvalidateanexistingmonitorreturnsokresponse1728501057","env:ci"],"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2","options":{"enable_logs_sample":true,"escalation_message":"the situation - has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"silenced":{}},"multi":true,"created_at":1728485695000,"created":"2024-10-09T14:54:55.594487+00:00","modified":"2024-10-09T14:54:55.594487+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":"Anika Maskara","handle":"anika.maskara@datadoghq.com","email":"anika.maskara@datadoghq.com","id":7557262}} + has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2.0,"warning":1.0},"timeout_h":24,"groupby_simple_monitor":false,"silenced":{}},"multi":true,"created_at":1728501058000,"created":"2024-10-09T19:10:58.207799+00:00","modified":"2024-10-09T19:10:58.207799+00:00","deleted":null,"restricted_roles":null,"priority":3,"restriction_policy":null,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com","id":2320499}} ' headers: @@ -32,14 +32,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 09 Oct 2024 14:54:55 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:57 GMT request: body: encoding: UTF-8 - string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_an_existing_monitor_returns_OK_response-1728485695","options":{"enable_logs_sample":true,"escalation_message":"the + string: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_an_existing_monitor_returns_OK_response-1728501057","options":{"enable_logs_sample":true,"escalation_message":"the situation has escalated","evaluation_delay":700,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notification_preset_name":"hide_handles","notify_audit":false,"notify_no_data":false,"on_missing_data":"show_and_notify_no_data","renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") - > 2","tags":["test:testvalidateanexistingmonitorreturnsokresponse1728485695","env:ci"],"type":"log + > 2","tags":["test:testvalidateanexistingmonitorreturnsokresponse1728501057","env:ci"],"type":"log alert"}' headers: Accept: @@ -47,7 +47,7 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v1/monitor/155758542/validate + uri: https://api.datadoghq.com/api/v1/monitor/155778021/validate response: body: encoding: UTF-8 @@ -60,18 +60,18 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Wed, 09 Oct 2024 14:54:55 GMT +- recorded_at: Wed, 09 Oct 2024 19:10:57 GMT request: body: null headers: Accept: - application/json method: DELETE - uri: https://api.datadoghq.com/api/v1/monitor/155758542 + uri: https://api.datadoghq.com/api/v1/monitor/155778021 response: body: encoding: UTF-8 - string: '{"deleted_monitor_id":155758542} + string: '{"deleted_monitor_id":155778021} ' headers: diff --git a/examples/v2/events/CreateEvent.rb b/examples/v2/events/CreateEvent.rb new file mode 100644 index 00000000000..206582c2c4b --- /dev/null +++ b/examples/v2/events/CreateEvent.rb @@ -0,0 +1,42 @@ +# Post a change event returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::EventsAPI.new + +body = DatadogAPIClient::V2::ChangeEventCreateRequest.new({ + attributes: DatadogAPIClient::V2::ChangeEvent.new({ + attributes: DatadogAPIClient::V2::ChangeEventCustomAttributes.new({ + author: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthor.new({ + name: "", + type: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthorType::USER, + }), + change_metadata: { + "resource_link": "/feature/fallback_payments_test", "user": "{'email': 'dd_user_email', 'name': 'dd_user'}", + }, + changed_resource: DatadogAPIClient::V2::ChangeEventCustomAttributesChangedResource.new({ + name: "fallback_payments_test", + type: DatadogAPIClient::V2::ChangeEventCustomAttributesChangedResourceType::FEATURE_FLAG, + }), + impacted_resources: [ + DatadogAPIClient::V2::ChangeEventCustomAttributesImpactedResourcesItems.new({ + name: "payments_api", + type: DatadogAPIClient::V2::ChangeEventCustomAttributesImpactedResourcesItemsType::SERVICE, + }), + ], + new_value: { + "enabled": "True", "percentage": "50%", "rule": "{'datacenter': 'us1.prod'}", + }, + prev_value: { + "enabled": "True", "percentage": "10%", "rule": "{'datacenter': 'us1.prod'}", + }, + }), + category: DatadogAPIClient::V2::ChangeEventCategory::CHANGE, + message: "payment_processed feature flag has been enabled", + tags: [ + "environment:test", + ], + title: "payment_processed feature flag updated", + }), + type: DatadogAPIClient::V2::ChangeEventCreateRequestType::EVENT, +}) +p api_instance.create_event(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 58b4b704f8f..ae0352665d2 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1224,6 +1224,9 @@ "page_cursor" => "String", "page_limit" => "Integer", }, + "v2.CreateEvent" => { + "body" => "ChangeEventCreateRequest", + }, "v2.SearchEvents" => { "body" => "EventsListRequest", }, diff --git a/features/v1/given.json b/features/v1/given.json index 4b7ae56d5b4..c4f7aa6976d 100644 --- a/features/v1/given.json +++ b/features/v1/given.json @@ -166,7 +166,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"name\": \"{{ unique }}\",\n \"type\": \"log alert\",\n \"query\": \"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\n \"message\": \"some message Notify: @hipchat-channel\",\n \"tags\": [\"test:{{ unique_lower_alnum }}\", \"env:ci\"],\n \"priority\": 3,\n \"options\": {\n \"enable_logs_sample\": true,\n \"escalation_message\": \"the situation has escalated\",\n \"evaluation_delay\": 700,\n \"groupby_simple_monitor\": true,\n \"include_tags\": true,\n \"locked\": false,\n \"new_host_delay\": 600,\n \"no_data_timeframe\": null,\n \"notify_audit\": false,\n \"notify_no_data\": false,\n \"on_missing_data\": \"show_and_notify_no_data\",\n \"notification_preset_name\": \"hide_handles\",\n \"renotify_interval\": 60,\n \"require_full_window\": true,\n \"timeout_h\": 24,\n \"thresholds\": { \"critical\": 2, \"warning\": 1 }\n }\n}\n" + "value": "{\n \"name\": \"{{ unique }}\",\n \"type\": \"log alert\",\n \"query\": \"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\n \"message\": \"some message Notify: @hipchat-channel\",\n \"tags\": [\"test:{{ unique_lower_alnum }}\", \"env:ci\"],\n \"priority\": 3,\n \"options\": {\n \"enable_logs_sample\": true,\n \"escalation_message\": \"the situation has escalated\",\n \"evaluation_delay\": 700,\n \"include_tags\": true,\n \"locked\": false,\n \"new_host_delay\": 600,\n \"no_data_timeframe\": null,\n \"notify_audit\": false,\n \"notify_no_data\": false,\n \"on_missing_data\": \"show_and_notify_no_data\",\n \"notification_preset_name\": \"hide_handles\",\n \"renotify_interval\": 60,\n \"require_full_window\": true,\n \"timeout_h\": 24,\n \"thresholds\": { \"critical\": 2, \"warning\": 1 }\n }\n}\n" } ], "step": "there is a valid \"monitor\" in the system", diff --git a/features/v2/events.feature b/features/v2/events.feature index 9a1c79072d1..76c85497671 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -7,24 +7,26 @@ Feature: Events Background: Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system And an instance of "Events" API @generated @skip @team:DataDog/event-management Scenario: Get a list of events returns "Bad Request" response - Given new "ListEvents" request + Given a valid "appKeyAuth" key in the system + And new "ListEvents" request When the request is sent Then the response status is 400 Bad Request @skip-validation @team:DataDog/event-management Scenario: Get a list of events returns "OK" response - Given new "ListEvents" request + Given a valid "appKeyAuth" key in the system + And new "ListEvents" request When the request is sent Then the response status is 200 OK @replay-only @skip-validation @team:DataDog/event-management @with-pagination Scenario: Get a list of events returns "OK" response with pagination - Given new "ListEvents" request + Given a valid "appKeyAuth" key in the system + And new "ListEvents" request And request contains "filter[from]" parameter with value "now-15m" And request contains "filter[to]" parameter with value "now" And request contains "page[limit]" parameter with value 2 @@ -34,7 +36,8 @@ Feature: Events @team:DataDog/event-management Scenario: Get a quick list of events returns "OK" response - Given new "ListEvents" request + Given a valid "appKeyAuth" key in the system + And new "ListEvents" request And request contains "filter[query]" parameter with value "datadog-agent" And request contains "filter[from]" parameter with value "2020-09-17T11:48:36+01:00" And request contains "filter[to]" parameter with value "2020-09-17T12:48:36+01:00" @@ -43,16 +46,25 @@ Feature: Events Then the response status is 200 OK And the response "data" has length 0 + @generated @skip @team:DataDog/event-management + Scenario: Post a change event returns "OK" response + Given new "CreateEvent" request + And body with value {"attributes": {"attributes": {"author": {"name": "", "type": "user"}, "change_metadata": {"resource_link": "/feature/fallback_payments_test", "user": {"email": "dd_user_email", "name": "dd_user"}}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["environment:test"], "title": "payment_processed feature flag updated"}, "type": "event"} + When the request is sent + Then the response status is 200 OK + @team:DataDog/event-management Scenario: Search events returns "Bad Request" response - Given new "SearchEvents" request + Given a valid "appKeyAuth" key in the system + And new "SearchEvents" request And body with value {"filter": {"from": "now-15m", "query": "service:web* AND @http.status_code:[200 TO 299]", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent Then the response status is 400 Bad Request @team:DataDog/event-management Scenario: Search events returns "OK" response - Given new "SearchEvents" request + Given a valid "appKeyAuth" key in the system + And new "SearchEvents" request And body with value {"filter": {"query": "datadog-agent", "from": "2020-09-17T11:48:36+01:00", "to": "2020-09-17T12:48:36+01:00"}, "sort": "timestamp", "page": {"limit": 5}} When the request is sent Then the response status is 200 OK @@ -60,7 +72,8 @@ Feature: Events @replay-only @skip-validation @team:DataDog/event-management @with-pagination Scenario: Search events returns "OK" response with pagination - Given new "SearchEvents" request + Given a valid "appKeyAuth" key in the system + And new "SearchEvents" request And body with value {"filter": {"from": "now-15m", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"} When the request with pagination is sent Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 62da7c99ef9..a1592e79b71 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -602,6 +602,12 @@ "type": "safe" } }, + "CreateEvent": { + "tag": "Events", + "undo": { + "type": "unsafe" + } + }, "SearchEvents": { "tag": "Events", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7b073d1fb09..8c220e55ac8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1037,6 +1037,21 @@ def overrides "v2.case_update_status" => "CaseUpdateStatus", "v2.case_update_status_attributes" => "CaseUpdateStatusAttributes", "v2.case_update_status_request" => "CaseUpdateStatusRequest", + "v2.change_event" => "ChangeEvent", + "v2.change_event_category" => "ChangeEventCategory", + "v2.change_event_create_request" => "ChangeEventCreateRequest", + "v2.change_event_create_request_type" => "ChangeEventCreateRequestType", + "v2.change_event_create_response" => "ChangeEventCreateResponse", + "v2.change_event_create_response_attributes" => "ChangeEventCreateResponseAttributes", + "v2.change_event_create_response_attributes_attributes" => "ChangeEventCreateResponseAttributesAttributes", + "v2.change_event_create_response_attributes_attributes_evt" => "ChangeEventCreateResponseAttributesAttributesEvt", + "v2.change_event_custom_attributes" => "ChangeEventCustomAttributes", + "v2.change_event_custom_attributes_author" => "ChangeEventCustomAttributesAuthor", + "v2.change_event_custom_attributes_author_type" => "ChangeEventCustomAttributesAuthorType", + "v2.change_event_custom_attributes_changed_resource" => "ChangeEventCustomAttributesChangedResource", + "v2.change_event_custom_attributes_changed_resource_type" => "ChangeEventCustomAttributesChangedResourceType", + "v2.change_event_custom_attributes_impacted_resources_items" => "ChangeEventCustomAttributesImpactedResourcesItems", + "v2.change_event_custom_attributes_impacted_resources_items_type" => "ChangeEventCustomAttributesImpactedResourcesItemsType", "v2.chargeback_breakdown" => "ChargebackBreakdown", "v2.ci_app_aggregate_bucket_value" => "CIAppAggregateBucketValue", "v2.ci_app_aggregate_bucket_value_timeseries_point" => "CIAppAggregateBucketValueTimeseriesPoint", diff --git a/lib/datadog_api_client/v2/api/events_api.rb b/lib/datadog_api_client/v2/api/events_api.rb index f6a9702988e..28791dd77c2 100644 --- a/lib/datadog_api_client/v2/api/events_api.rb +++ b/lib/datadog_api_client/v2/api/events_api.rb @@ -23,6 +23,73 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Post a change event. + # + # @see #create_event_with_http_info + def create_event(body, opts = {}) + data, _status_code, _headers = create_event_with_http_info(body, opts) + data + end + + # Post a change event. + # + # This endpoint allows you to post events. Only events with `change` category are supported. + # + # @param body [ChangeEventCreateRequest] Event request object + # @param opts [Hash] the optional parameters + # @return [Array<(ChangeEventCreateResponse, Integer, Hash)>] ChangeEventCreateResponse data, response status code and response headers + def create_event_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EventsAPI.create_event ...' + 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 EventsAPI.create_event" + end + # resource path + local_var_path = '/api/v2/events' + + # 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] || 'ChangeEventCreateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth] + + new_options = opts.merge( + :operation => :create_event, + :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: EventsAPI#create_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a list of events. # # @see #list_events_with_http_info diff --git a/lib/datadog_api_client/v2/models/change_event.rb b/lib/datadog_api_client/v2/models/change_event.rb new file mode 100644 index 00000000000..3c5ff96f541 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event.rb @@ -0,0 +1,237 @@ +=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 + # Object representing a change event. + class ChangeEvent + include BaseGenericModel + + # An arbitrary string to use for aggregation. Limited to 100 characters. + # If you specify a key, all events using that key are grouped together in the Event Stream. + attr_reader :aggregation_key + + # Object representing custom event attributes. + attr_reader :attributes + + # Event category to identify the type of event. Only the value `change` is supported. + attr_reader :category + + # The body of the event. Limited to 4000 characters. + attr_reader :message + + # A list of tags to apply to the event. + # Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/). + attr_accessor :tags + + # Timestamp in which the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + # For example `"2017-01-15T01:30:15.010000Z"`. + # Defaults to now. Limited to values no older than 18 hours. + attr_accessor :timestamp + + # The event title. Limited to 500 characters. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation_key' => :'aggregation_key', + :'attributes' => :'attributes', + :'category' => :'category', + :'message' => :'message', + :'tags' => :'tags', + :'timestamp' => :'timestamp', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation_key' => :'String', + :'attributes' => :'ChangeEventCustomAttributes', + :'category' => :'ChangeEventCategory', + :'message' => :'String', + :'tags' => :'Array', + :'timestamp' => :'String', + :'title' => :'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::ChangeEvent` 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?(:'aggregation_key') + self.aggregation_key = attributes[:'aggregation_key'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] + 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 !@aggregation_key.nil? && @aggregation_key.to_s.length > 100 + return false if @attributes.nil? + return false if @category.nil? + return false if !@message.nil? && @message.to_s.length > 4000 + return false if @title.nil? + return false if @title.to_s.length > 500 + true + end + + # Custom attribute writer method with validation + # @param aggregation_key [Object] Object to be assigned + # @!visibility private + def aggregation_key=(aggregation_key) + if !aggregation_key.nil? && aggregation_key.to_s.length > 100 + fail ArgumentError, 'invalid value for "aggregation_key", the character length must be smaller than or equal to 100.' + end + @aggregation_key = aggregation_key + 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 category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if !message.nil? && message.to_s.length > 4000 + fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 4000.' + end + @message = message + 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 + if title.to_s.length > 500 + fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 500.' + end + @title = title + 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 && + aggregation_key == o.aggregation_key && + attributes == o.attributes && + category == o.category && + message == o.message && + tags == o.tags && + timestamp == o.timestamp && + title == o.title + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation_key, attributes, category, message, tags, timestamp, title].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_category.rb b/lib/datadog_api_client/v2/models/change_event_category.rb new file mode 100644 index 00000000000..9ce4de9a21b --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_category.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 + # Event category to identify the type of event. Only the value `change` is supported. + class ChangeEventCategory + include BaseEnumModel + + CHANGE = "change".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_create_request.rb b/lib/datadog_api_client/v2/models/change_event_create_request.rb new file mode 100644 index 00000000000..f85200c9e51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_create_request.rb @@ -0,0 +1,115 @@ +=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 + # Object representing an event. + class ChangeEventCreateRequest + include BaseGenericModel + + # Object representing a change event. + attr_accessor :attributes + + # Entity 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ChangeEvent', + :'type' => :'ChangeEventCreateRequestType' + } + 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::ChangeEventCreateRequest` 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 + + # 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].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_create_request_type.rb b/lib/datadog_api_client/v2/models/change_event_create_request_type.rb new file mode 100644 index 00000000000..9eb00524b2d --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_create_request_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 + # Entity type. + class ChangeEventCreateRequestType + include BaseEnumModel + + EVENT = "event".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_create_response.rb b/lib/datadog_api_client/v2/models/change_event_create_response.rb new file mode 100644 index 00000000000..b35873d24bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_create_response.rb @@ -0,0 +1,115 @@ +=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 + # Object containing an event response. + class ChangeEventCreateResponse + include BaseGenericModel + + # The definition of `ChangeEventCreateResponseAttributes` object. + attr_accessor :attributes + + # Event 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ChangeEventCreateResponseAttributes', + :'type' => :'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::ChangeEventCreateResponse` 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 + + # 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].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_create_response_attributes.rb b/lib/datadog_api_client/v2/models/change_event_create_response_attributes.rb new file mode 100644 index 00000000000..68381983cc2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_create_response_attributes.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 + # The definition of `ChangeEventCreateResponseAttributes` object. + class ChangeEventCreateResponseAttributes + include BaseGenericModel + + # The definition of `ChangeEventCreateResponseAttributesAttributes` object. + attr_accessor :attributes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ChangeEventCreateResponseAttributesAttributes' + } + 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::ChangeEventCreateResponseAttributes` 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 + 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 + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_create_response_attributes_attributes.rb b/lib/datadog_api_client/v2/models/change_event_create_response_attributes_attributes.rb new file mode 100644 index 00000000000..f5a2f3b50c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_create_response_attributes_attributes.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 + # The definition of `ChangeEventCreateResponseAttributesAttributes` object. + class ChangeEventCreateResponseAttributesAttributes + include BaseGenericModel + + # The definition of `ChangeEventCreateResponseAttributesAttributesEvt` object. + attr_accessor :evt + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'evt' => :'evt' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'evt' => :'ChangeEventCreateResponseAttributesAttributesEvt' + } + 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::ChangeEventCreateResponseAttributesAttributes` 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?(:'evt') + self.evt = attributes[:'evt'] + 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 && + evt == o.evt + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [evt].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_create_response_attributes_attributes_evt.rb b/lib/datadog_api_client/v2/models/change_event_create_response_attributes_attributes_evt.rb new file mode 100644 index 00000000000..a33e2a31d40 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_create_response_attributes_attributes_evt.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 + # The definition of `ChangeEventCreateResponseAttributesAttributesEvt` object. + class ChangeEventCreateResponseAttributesAttributesEvt + include BaseGenericModel + + # Event id + attr_accessor :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'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::ChangeEventCreateResponseAttributesAttributesEvt` 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?(:'id') + self.id = attributes[:'id'] + 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 && + id == o.id + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_custom_attributes.rb b/lib/datadog_api_client/v2/models/change_event_custom_attributes.rb new file mode 100644 index 00000000000..95c1cc52364 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_custom_attributes.rb @@ -0,0 +1,176 @@ +=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 + # Object representing custom event attributes. + class ChangeEventCustomAttributes + include BaseGenericModel + + # Object representing the entity which made the change. Optional field but if provided should include `type` and `name`. + attr_accessor :author + + # Free form object with any related information of the `change` event. + attr_accessor :change_metadata + + # Object representing a uniquely identified resource. Only the resource type `feature_flag` is supported. + attr_reader :changed_resource + + # A list of resources impacted by this change. At least one resource is required. Only resources + # of type `service` are supported. + attr_accessor :impacted_resources + + # Free form object to track new value of the changed resource. + attr_accessor :new_value + + # Free form object to track previous value of the changed resource. + attr_accessor :prev_value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'change_metadata' => :'change_metadata', + :'changed_resource' => :'changed_resource', + :'impacted_resources' => :'impacted_resources', + :'new_value' => :'new_value', + :'prev_value' => :'prev_value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'ChangeEventCustomAttributesAuthor', + :'change_metadata' => :'Object', + :'changed_resource' => :'ChangeEventCustomAttributesChangedResource', + :'impacted_resources' => :'Array', + :'new_value' => :'Object', + :'prev_value' => :'Object' + } + 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::ChangeEventCustomAttributes` 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?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'change_metadata') + self.change_metadata = attributes[:'change_metadata'] + end + + if attributes.key?(:'changed_resource') + self.changed_resource = attributes[:'changed_resource'] + end + + if attributes.key?(:'impacted_resources') + if (value = attributes[:'impacted_resources']).is_a?(Array) + self.impacted_resources = value + end + end + + if attributes.key?(:'new_value') + self.new_value = attributes[:'new_value'] + end + + if attributes.key?(:'prev_value') + self.prev_value = attributes[:'prev_value'] + 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 @changed_resource.nil? + true + end + + # Custom attribute writer method with validation + # @param changed_resource [Object] Object to be assigned + # @!visibility private + def changed_resource=(changed_resource) + if changed_resource.nil? + fail ArgumentError, 'invalid value for "changed_resource", changed_resource cannot be nil.' + end + @changed_resource = changed_resource + 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 && + author == o.author && + change_metadata == o.change_metadata && + changed_resource == o.changed_resource && + impacted_resources == o.impacted_resources && + new_value == o.new_value && + prev_value == o.prev_value + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, change_metadata, changed_resource, impacted_resources, new_value, prev_value].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_custom_attributes_author.rb b/lib/datadog_api_client/v2/models/change_event_custom_attributes_author.rb new file mode 100644 index 00000000000..076c1ed5c10 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_custom_attributes_author.rb @@ -0,0 +1,148 @@ +=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 + # Object representing the entity which made the change. Optional field but if provided should include `type` and `name`. + class ChangeEventCustomAttributesAuthor + include BaseGenericModel + + # Author's name. Limited to 128 characters. + attr_reader :name + + # Author's type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ChangeEventCustomAttributesAuthorType' + } + 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::ChangeEventCustomAttributesAuthor` 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?(:'name') + self.name = attributes[:'name'] + 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 @name.nil? + return false if @name.to_s.length > 128.0 + return false if @type.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 + if name.to_s.length > 128.0 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 128.0.' + end + @name = name + 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 && + name == o.name && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_custom_attributes_author_type.rb b/lib/datadog_api_client/v2/models/change_event_custom_attributes_author_type.rb new file mode 100644 index 00000000000..cdb818702f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_custom_attributes_author_type.rb @@ -0,0 +1,27 @@ +=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 + # Author's type. + class ChangeEventCustomAttributesAuthorType + include BaseEnumModel + + USER = "user".freeze + SYSTEM = "system".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.rb b/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.rb new file mode 100644 index 00000000000..4faaf472d2e --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource.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 + # Object representing a uniquely identified resource. Only the resource type `feature_flag` is supported. + class ChangeEventCustomAttributesChangedResource + include BaseGenericModel + + # Resource's name. + attr_reader :name + + # Resource's type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ChangeEventCustomAttributesChangedResourceType' + } + 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::ChangeEventCustomAttributesChangedResource` 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?(:'name') + self.name = attributes[:'name'] + 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 @name.nil? + return false if @type.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 + + # 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 && + name == o.name && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource_type.rb b/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_resource_type.rb new file mode 100644 index 00000000000..feb61467bdb --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_custom_attributes_changed_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 + # Resource's type. + class ChangeEventCustomAttributesChangedResourceType + include BaseEnumModel + + FEATURE_FLAG = "feature_flag".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items.rb b/lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items.rb new file mode 100644 index 00000000000..55c50b65aa8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items.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 + # Object representing a uniquely identified resource. Only the resource type `service` is supported. + class ChangeEventCustomAttributesImpactedResourcesItems + include BaseGenericModel + + # Resource's name. + attr_reader :name + + # Resource's type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ChangeEventCustomAttributesImpactedResourcesItemsType' + } + 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::ChangeEventCustomAttributesImpactedResourcesItems` 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?(:'name') + self.name = attributes[:'name'] + 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 @name.nil? + return false if @type.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 + + # 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 && + name == o.name && + type == o.type + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items_type.rb b/lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items_type.rb new file mode 100644 index 00000000000..930c49b28db --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_custom_attributes_impacted_resources_items_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 + # Resource's type. + class ChangeEventCustomAttributesImpactedResourcesItemsType + include BaseEnumModel + + SERVICE = "service".freeze + end +end