-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit e7e2a6e5 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Oct 15, 2024
1 parent
17306bb
commit ac660ff
Showing
26 changed files
with
2,202 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Post a change event returns "OK" response | ||
|
||
require "datadog_api_client" | ||
DatadogAPIClient.configure do |config| | ||
config.unstable_operations["v2.create_event".to_sym] = true | ||
end | ||
api_instance = DatadogAPIClient::V2::EventsAPI.new | ||
|
||
body = DatadogAPIClient::V2::ChangeEventCreateRequestPayload.new({ | ||
data: DatadogAPIClient::V2::ChangeEventCreateRequest.new({ | ||
attributes: DatadogAPIClient::V2::ChangeEvent.new({ | ||
attributes: DatadogAPIClient::V2::ChangeEventCustomAttributes.new({ | ||
author: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthor.new({ | ||
name: "user_name", | ||
type: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthorType::USER, | ||
}), | ||
change_metadata: { | ||
"resource_link": "/feature/fallback_payments_test", "user": "{'email': 'user@example.com', '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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.