Skip to content

Commit ac660ff

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e7e2a6e5 of spec repo
1 parent 17306bb commit ac660ff

26 files changed

+2202
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-10-10 19:46:04.854996",
8-
"spec_repo_commit": "049920eb"
7+
"regenerated": "2024-10-15 08:56:15.902250",
8+
"spec_repo_commit": "e7e2a6e5"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-10 19:46:04.873453",
13-
"spec_repo_commit": "049920eb"
12+
"regenerated": "2024-10-15 08:56:15.920605",
13+
"spec_repo_commit": "e7e2a6e5"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3951,6 +3951,240 @@ components:
39513951
format: int64
39523952
type: integer
39533953
type: object
3954+
ChangeEvent:
3955+
description: Object representing a change event.
3956+
properties:
3957+
aggregation_key:
3958+
description: 'An arbitrary string to use for aggregation. Limited to 100
3959+
characters.
3960+
3961+
If you specify a key, all events using that key are grouped together in
3962+
the Event Stream.'
3963+
maxLength: 100
3964+
type: string
3965+
attributes:
3966+
$ref: '#/components/schemas/ChangeEventCustomAttributes'
3967+
category:
3968+
$ref: '#/components/schemas/ChangeEventCategory'
3969+
message:
3970+
description: The body of the event. Limited to 4000 characters.
3971+
example: payment_processed feature flag has been enabled
3972+
maxLength: 4000
3973+
type: string
3974+
tags:
3975+
description: 'A list of tags to apply to the event.
3976+
3977+
Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).'
3978+
example:
3979+
- environment:test
3980+
items:
3981+
description: A tag.
3982+
type: string
3983+
type: array
3984+
timestamp:
3985+
description: 'Timestamp in which the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
3986+
format.
3987+
3988+
For example `"2017-01-15T01:30:15.010000Z"`.
3989+
3990+
Defaults to now. Limited to values no older than 18 hours.'
3991+
type: string
3992+
title:
3993+
description: The event title. Limited to 500 characters.
3994+
example: payment_processed feature flag updated
3995+
maxLength: 500
3996+
type: string
3997+
required:
3998+
- title
3999+
- category
4000+
- attributes
4001+
type: object
4002+
ChangeEventCategory:
4003+
description: Event category to identify the type of event. Only the value `change`
4004+
is supported.
4005+
enum:
4006+
- change
4007+
example: change
4008+
type: string
4009+
x-enum-varnames:
4010+
- CHANGE
4011+
ChangeEventCreateRequest:
4012+
description: Object representing an event.
4013+
properties:
4014+
attributes:
4015+
$ref: '#/components/schemas/ChangeEvent'
4016+
type:
4017+
$ref: '#/components/schemas/ChangeEventCreateRequestType'
4018+
type: object
4019+
ChangeEventCreateRequestPayload:
4020+
description: Create an event.
4021+
properties:
4022+
data:
4023+
$ref: '#/components/schemas/ChangeEventCreateRequest'
4024+
type: object
4025+
ChangeEventCreateRequestType:
4026+
description: Entity type.
4027+
enum:
4028+
- event
4029+
example: event
4030+
type: string
4031+
x-enum-varnames:
4032+
- EVENT
4033+
ChangeEventCreateResponse:
4034+
description: Object containing an event response.
4035+
properties:
4036+
attributes:
4037+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributes'
4038+
type:
4039+
description: Event type
4040+
type: string
4041+
type: object
4042+
ChangeEventCreateResponseAttributes:
4043+
description: The definition of `ChangeEventCreateResponseAttributes` object.
4044+
properties:
4045+
attributes:
4046+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributes'
4047+
type: object
4048+
ChangeEventCreateResponseAttributesAttributes:
4049+
description: The definition of `ChangeEventCreateResponseAttributesAttributes`
4050+
object.
4051+
properties:
4052+
evt:
4053+
$ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributesEvt'
4054+
type: object
4055+
ChangeEventCreateResponseAttributesAttributesEvt:
4056+
description: The definition of `ChangeEventCreateResponseAttributesAttributesEvt`
4057+
object.
4058+
properties:
4059+
id:
4060+
description: Event id
4061+
type: string
4062+
type: object
4063+
ChangeEventCreateResponsePayload:
4064+
description: Response containing information about created event.
4065+
properties:
4066+
data:
4067+
$ref: '#/components/schemas/ChangeEventCreateResponse'
4068+
type: object
4069+
ChangeEventCustomAttributes:
4070+
description: Object representing custom event attributes.
4071+
properties:
4072+
author:
4073+
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthor'
4074+
change_metadata:
4075+
additionalProperties: {}
4076+
description: Free form object with any related information of the `change`
4077+
event.
4078+
example:
4079+
resource_link: /feature/fallback_payments_test
4080+
user:
4081+
4082+
name: dd_user
4083+
type: object
4084+
changed_resource:
4085+
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResource'
4086+
impacted_resources:
4087+
description: 'A list of resources impacted by this change. At least one
4088+
resource is required. Only resources
4089+
4090+
of type `service` are supported.'
4091+
example:
4092+
- name: payments_api
4093+
type: service
4094+
items:
4095+
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems'
4096+
minItems: 1
4097+
type: array
4098+
new_value:
4099+
additionalProperties: {}
4100+
description: Free form object to track new value of the changed resource.
4101+
example:
4102+
enabled: true
4103+
percentage: 50%
4104+
rule:
4105+
datacenter: us1.prod
4106+
type: object
4107+
prev_value:
4108+
additionalProperties: {}
4109+
description: Free form object to track previous value of the changed resource.
4110+
example:
4111+
enabled: true
4112+
percentage: 10%
4113+
rule:
4114+
datacenter: us1.prod
4115+
type: object
4116+
required:
4117+
- changed_resource
4118+
type: object
4119+
ChangeEventCustomAttributesAuthor:
4120+
description: Object representing the entity which made the change. Optional
4121+
field but if provided should include `type` and `name`.
4122+
properties:
4123+
name:
4124+
description: Author's name. Limited to 128 characters.
4125+
example: user_name
4126+
maxLength: 128
4127+
type: string
4128+
type:
4129+
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType'
4130+
required:
4131+
- name
4132+
- type
4133+
type: object
4134+
ChangeEventCustomAttributesAuthorType:
4135+
description: Author's type.
4136+
enum:
4137+
- user
4138+
- system
4139+
example: user
4140+
type: string
4141+
x-enum-varnames:
4142+
- USER
4143+
- SYSTEM
4144+
ChangeEventCustomAttributesChangedResource:
4145+
description: Object representing a uniquely identified resource. Only the resource
4146+
type `feature_flag` is supported.
4147+
properties:
4148+
name:
4149+
description: Resource's name.
4150+
example: fallback_payments_test
4151+
type: string
4152+
type:
4153+
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType'
4154+
required:
4155+
- type
4156+
- name
4157+
type: object
4158+
ChangeEventCustomAttributesChangedResourceType:
4159+
description: Resource's type.
4160+
enum:
4161+
- feature_flag
4162+
example: feature_flag
4163+
type: string
4164+
x-enum-varnames:
4165+
- FEATURE_FLAG
4166+
ChangeEventCustomAttributesImpactedResourcesItems:
4167+
description: Object representing a uniquely identified resource. Only the resource
4168+
type `service` is supported.
4169+
properties:
4170+
name:
4171+
description: Resource's name.
4172+
example: payments_api
4173+
type: string
4174+
type:
4175+
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType'
4176+
required:
4177+
- type
4178+
- name
4179+
type: object
4180+
ChangeEventCustomAttributesImpactedResourcesItemsType:
4181+
description: Resource's type.
4182+
enum:
4183+
- service
4184+
example: service
4185+
type: string
4186+
x-enum-varnames:
4187+
- SERVICE
39544188
ChargebackBreakdown:
39554189
description: Charges breakdown.
39564190
properties:
@@ -29664,6 +29898,47 @@ paths:
2966429898
operator: OR
2966529899
permissions:
2966629900
- events_read
29901+
post:
29902+
description: This endpoint allows you to post events. Only events with `change`
29903+
category are supported.
29904+
operationId: CreateEvent
29905+
requestBody:
29906+
content:
29907+
application/json:
29908+
schema:
29909+
$ref: '#/components/schemas/ChangeEventCreateRequestPayload'
29910+
description: Event request object
29911+
required: true
29912+
responses:
29913+
'200':
29914+
content:
29915+
application/json:
29916+
schema:
29917+
$ref: '#/components/schemas/ChangeEventCreateResponsePayload'
29918+
description: OK
29919+
'400':
29920+
content:
29921+
application/json:
29922+
schema:
29923+
$ref: '#/components/schemas/JSONAPIErrorResponse'
29924+
description: Bad request
29925+
'403':
29926+
content:
29927+
application/json:
29928+
schema:
29929+
$ref: '#/components/schemas/JSONAPIErrorResponse'
29930+
description: Forbidden
29931+
'429':
29932+
$ref: '#/components/responses/TooManyRequestsResponse'
29933+
security:
29934+
- apiKeyAuth: []
29935+
summary: Post a change event
29936+
tags:
29937+
- Events
29938+
x-codegen-request-body-name: body
29939+
x-unstable: '**Note**: This endpoint is in **Preview**.
29940+
29941+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
2966729942
/api/v2/events/search:
2966829943
post:
2966929944
description: 'List endpoint returns events that match an events search query.

examples/v2/events/CreateEvent.rb

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Post a change event returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_event".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::EventsAPI.new
8+
9+
body = DatadogAPIClient::V2::ChangeEventCreateRequestPayload.new({
10+
data: DatadogAPIClient::V2::ChangeEventCreateRequest.new({
11+
attributes: DatadogAPIClient::V2::ChangeEvent.new({
12+
attributes: DatadogAPIClient::V2::ChangeEventCustomAttributes.new({
13+
author: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthor.new({
14+
name: "user_name",
15+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthorType::USER,
16+
}),
17+
change_metadata: {
18+
"resource_link": "/feature/fallback_payments_test", "user": "{'email': '[email protected]', 'name': 'dd_user'}",
19+
},
20+
changed_resource: DatadogAPIClient::V2::ChangeEventCustomAttributesChangedResource.new({
21+
name: "fallback_payments_test",
22+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesChangedResourceType::FEATURE_FLAG,
23+
}),
24+
impacted_resources: [
25+
DatadogAPIClient::V2::ChangeEventCustomAttributesImpactedResourcesItems.new({
26+
name: "payments_api",
27+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesImpactedResourcesItemsType::SERVICE,
28+
}),
29+
],
30+
new_value: {
31+
"enabled": "True", "percentage": "50%", "rule": "{'datacenter': 'us1.prod'}",
32+
},
33+
prev_value: {
34+
"enabled": "True", "percentage": "10%", "rule": "{'datacenter': 'us1.prod'}",
35+
},
36+
}),
37+
category: DatadogAPIClient::V2::ChangeEventCategory::CHANGE,
38+
message: "payment_processed feature flag has been enabled",
39+
tags: [
40+
"environment:test",
41+
],
42+
title: "payment_processed feature flag updated",
43+
}),
44+
type: DatadogAPIClient::V2::ChangeEventCreateRequestType::EVENT,
45+
}),
46+
})
47+
p api_instance.create_event(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,9 @@
12241224
"page_cursor" => "String",
12251225
"page_limit" => "Integer",
12261226
},
1227+
"v2.CreateEvent" => {
1228+
"body" => "ChangeEventCreateRequestPayload",
1229+
},
12271230
"v2.SearchEvents" => {
12281231
"body" => "EventsListRequest",
12291232
},

0 commit comments

Comments
 (0)