Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions examples/v1/events/CreateEvent_3293844778.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Post an event returns "OK" response with an int64 ID above 2^53

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::EventsAPI.new

body = DatadogAPIClient::V1::EventCreateRequest.new({
title: "Example-Event",
text: "An event whose ID exceeds Number.MAX_SAFE_INTEGER.",
tags: [
"test:ExampleEvent",
],
})
p api_instance.create_event(body)
9 changes: 9 additions & 0 deletions features/v1/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ Feature: Events
Then the response status is 202 OK
And the response "event.text" is equal to "A text message."

@team:ddoghq/monitors-evaluation
Scenario: Post an event returns "OK" response with an int64 ID above 2^53
Given new "CreateEvent" request
And body with value {"title": "{{ unique }}", "text": "An event whose ID exceeds Number.MAX_SAFE_INTEGER.", "tags": ["test:{{ unique_alnum }}"]}
When the request is sent
Then the response status is 202 OK
And the response "event" has field "id"
And the response "event" has field "id_str"

@team:ddoghq/monitors-evaluation
Scenario: Post an event with a long title returns "OK" response
Given new "CreateEvent" request
Expand Down
7 changes: 7 additions & 0 deletions generated-test/test-runner-data/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,13 @@
"scenario": "Post an event returns \"OK\" response",
"version": "v1"
},
{
"feature": "Events",
"feature_file": "../../features/v1/events.feature",
"file": "v1/events/post-an-event-returns-ok-response-with-an-int64-id-above-2-53.json",
"scenario": "Post an event returns \"OK\" response with an int64 ID above 2^53",
"version": "v1"
},
{
"feature": "Events",
"feature_file": "../../features/v1/events.feature",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"api": "Events",
"expected_status": 202,
"feature": "Events",
"id": "v1/Events/Post an event returns \"OK\" response with an int64 ID above 2^53",
"operation_id": "CreateEvent",
"request": {
"body": {
"schema": {
"format": null,
"ref": "EventCreateRequest",
"type": "object"
},
"source": "inline",
"value": {
"tags": [
"test:{{ unique_alnum }}"
],
"text": "An event whose ID exceeds Number.MAX_SAFE_INTEGER.",
"title": "{{ unique }}"
}
},
"content_type": "application/json",
"method": "POST",
"pagination": false,
"parameters": [],
"path": "/api/v1/events"
},
"scenario": "Post an event returns \"OK\" response with an int64 ID above 2^53",
"schema_version": 1,
"version": "v1"
}
37 changes: 37 additions & 0 deletions generated-test/test-server-data/v1/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,43 @@
"scenario": "Post an event returns \"OK\" response",
"version": "v1"
},
{
"feature": "Events",
"frozen_at": "2022-01-06T00:50:51.866Z",
"interactions": [
{
"request": {
"body": {
"type": "json",
"value": {
"tags": [
"test:TestPostaneventreturnsOKresponsewithanint64IDabove2531641430251"
],
"text": "An event whose ID exceeds Number.MAX_SAFE_INTEGER.",
"title": "Test-Post_an_event_returns_OK_response_with_an_int64_ID_above_2_53-1641430251"
}
},
"content_type": "application/json",
"method": "POST",
"path": "/api/v1/events",
"query": []
},
"response": {
"body": {
"encoding": "text",
"value": "{\"status\":\"ok\",\"event\":{\"id\":6327818702635911000,\"id_str\":\"6327818702635911562\",\"title\":\"Test-Post_an_event_returns_OK_response_with_an_int64_ID_above_2_53-1641430251\",\"text\":\"An event whose ID exceeds Number.MAX_SAFE_INTEGER.\",\"date_happened\":1641430251,\"handle\":null,\"priority\":null,\"related_event_id\":null,\"tags\":[\"test:TestPostaneventreturnsOKresponsewithanint64IDabove2531641430251\"],\"url\":\"https://app.datadoghq.com/event/event?id=6327818702635911562\"}}"
},
"headers": {
"content-type": "application/json"
},
"reason": "Accepted",
"status": 202
}
}
],
"scenario": "Post an event returns \"OK\" response with an int64 ID above 2^53",
"version": "v1"
},
{
"feature": "Events",
"frozen_at": "2022-01-06T00:50:51.994Z",
Expand Down
Loading