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
1,294 changes: 1,294 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-05-27T20:28:17.108Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-05-27T20:28:17.632Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-05-27T20:28:17.883Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-05-27T20:28:18.281Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-05-27T20:28:18.537Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions examples/v2/annotations/CreateAnnotation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Create an annotation returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.create_annotation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::AnnotationsAPI.new

body = DatadogAPIClient::V2::AnnotationCreateRequest.new({
data: DatadogAPIClient::V2::AnnotationRequestData.new({
attributes: DatadogAPIClient::V2::AnnotationCreateAttributes.new({
color: DatadogAPIClient::V2::AnnotationColor::BLUE,
description: "Deployed v2.3.1 to production.",
page_id: "dashboard:abc-def-xyz",
start_time: 1704067200000,
type: DatadogAPIClient::V2::AnnotationKind::POINT_IN_TIME,
widget_ids: [
"1234567890",
],
}),
type: DatadogAPIClient::V2::AnnotationType::ANNOTATION,
}),
})
p api_instance.create_annotation(body)
11 changes: 11 additions & 0 deletions examples/v2/annotations/DeleteAnnotation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Delete an annotation returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.delete_annotation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::AnnotationsAPI.new

# there is a valid "annotation" in the system
ANNOTATION_DATA_ID = ENV["ANNOTATION_DATA_ID"]
api_instance.delete_annotation(ANNOTATION_DATA_ID)
11 changes: 11 additions & 0 deletions examples/v2/annotations/GetPageAnnotations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Get annotations for a page returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_page_annotations".to_sym] = true
end
api_instance = DatadogAPIClient::V2::AnnotationsAPI.new

# there is a valid "annotation" in the system
ANNOTATION_DATA_ATTRIBUTES_PAGE_ID = ENV["ANNOTATION_DATA_ATTRIBUTES_PAGE_ID"]
p api_instance.get_page_annotations(ANNOTATION_DATA_ATTRIBUTES_PAGE_ID, 1704067200000, 1704153600000)
11 changes: 11 additions & 0 deletions examples/v2/annotations/ListAnnotations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# List annotations returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_annotations".to_sym] = true
end
api_instance = DatadogAPIClient::V2::AnnotationsAPI.new

# there is a valid "annotation" in the system
ANNOTATION_DATA_ATTRIBUTES_PAGE_ID = ENV["ANNOTATION_DATA_ATTRIBUTES_PAGE_ID"]
p api_instance.list_annotations(ANNOTATION_DATA_ATTRIBUTES_PAGE_ID, 1704067200000, 1704153600000)
24 changes: 24 additions & 0 deletions examples/v2/annotations/UpdateAnnotation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Update an annotation returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_annotation".to_sym] = true
end
api_instance = DatadogAPIClient::V2::AnnotationsAPI.new

# there is a valid "annotation" in the system
ANNOTATION_DATA_ID = ENV["ANNOTATION_DATA_ID"]

body = DatadogAPIClient::V2::AnnotationUpdateRequest.new({
data: DatadogAPIClient::V2::AnnotationRequestData.new({
attributes: DatadogAPIClient::V2::AnnotationCreateAttributes.new({
color: DatadogAPIClient::V2::AnnotationColor::GREEN,
description: "Updated annotation.",
page_id: "dashboard:abc-def-xyz",
start_time: 1704067200000,
type: DatadogAPIClient::V2::AnnotationKind::POINT_IN_TIME,
}),
type: DatadogAPIClient::V2::AnnotationType::ANNOTATION,
}),
})
p api_instance.update_annotation(ANNOTATION_DATA_ID, body)
Loading
Loading