Skip to content

Commit dd4b20e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1d714a29 of spec repo
1 parent 50b1aac commit dd4b20e

26 files changed

+2244
-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-11-15 19:35:16.522070",
8-
"spec_repo_commit": "ad80112e"
7+
"regenerated": "2024-11-18 11:16:20.955488",
8+
"spec_repo_commit": "1d714a29"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-11-15 19:35:16.540620",
13-
"spec_repo_commit": "ad80112e"
12+
"regenerated": "2024-11-18 11:16:20.974647",
13+
"spec_repo_commit": "1d714a29"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4556,6 +4556,127 @@ components:
45564556
format: int64
45574557
type: integer
45584558
type: object
4559+
ChangeEventCustomAttributes:
4560+
description: Object representing custom change event attributes.
4561+
properties:
4562+
author:
4563+
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthor'
4564+
change_metadata:
4565+
additionalProperties: {}
4566+
description: Free form object with information related to the `change` event.
4567+
Can be arbitrarily nested and contain any valid JSON.
4568+
example:
4569+
dd:
4570+
team: datadog_team
4571+
user_email: [email protected]
4572+
user_id: datadog_user_id
4573+
user_name: datadog_username
4574+
resource_link: datadog.com/feature/fallback_payments_test
4575+
type: object
4576+
changed_resource:
4577+
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResource'
4578+
impacted_resources:
4579+
description: 'A list of resources impacted by this change. It is recommended
4580+
to provide an impacted resource to display
4581+
4582+
the change event at the right location. Only resources of type `service`
4583+
are supported.'
4584+
example:
4585+
- name: payments_api
4586+
type: service
4587+
items:
4588+
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems'
4589+
type: array
4590+
new_value:
4591+
additionalProperties: {}
4592+
description: Free form object to track new value of the changed resource.
4593+
example:
4594+
enabled: true
4595+
percentage: 50%
4596+
rule:
4597+
datacenter: devcycle.us1.prod
4598+
type: object
4599+
prev_value:
4600+
additionalProperties: {}
4601+
description: Free form object to track previous value of the changed resource.
4602+
example:
4603+
enabled: true
4604+
percentage: 10%
4605+
rule:
4606+
datacenter: devcycle.us1.prod
4607+
type: object
4608+
required:
4609+
- changed_resource
4610+
type: object
4611+
ChangeEventCustomAttributesAuthor:
4612+
description: Object representing the entity which made the change. Optional
4613+
field but if provided should include `type` and `name`.
4614+
properties:
4615+
name:
4616+
description: Author's name. Limited to 128 characters.
4617+
4618+
maxLength: 128
4619+
type: string
4620+
type:
4621+
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType'
4622+
required:
4623+
- name
4624+
- type
4625+
type: object
4626+
ChangeEventCustomAttributesAuthorType:
4627+
description: Author's type.
4628+
enum:
4629+
- user
4630+
- system
4631+
example: user
4632+
type: string
4633+
x-enum-varnames:
4634+
- USER
4635+
- SYSTEM
4636+
ChangeEventCustomAttributesChangedResource:
4637+
description: Object representing a uniquely identified resource. Only the resource
4638+
type `feature_flag` is supported.
4639+
properties:
4640+
name:
4641+
description: Resource's name.
4642+
example: fallback_payments_test
4643+
type: string
4644+
type:
4645+
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType'
4646+
required:
4647+
- type
4648+
- name
4649+
type: object
4650+
ChangeEventCustomAttributesChangedResourceType:
4651+
description: Resource's type.
4652+
enum:
4653+
- feature_flag
4654+
example: feature_flag
4655+
type: string
4656+
x-enum-varnames:
4657+
- FEATURE_FLAG
4658+
ChangeEventCustomAttributesImpactedResourcesItems:
4659+
description: Object representing a uniquely identified resource. Only the resource
4660+
type `service` is supported.
4661+
properties:
4662+
name:
4663+
description: Resource's name.
4664+
example: payments_api
4665+
type: string
4666+
type:
4667+
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType'
4668+
required:
4669+
- type
4670+
- name
4671+
type: object
4672+
ChangeEventCustomAttributesImpactedResourcesItemsType:
4673+
description: Resource's type.
4674+
enum:
4675+
- service
4676+
example: service
4677+
type: string
4678+
x-enum-varnames:
4679+
- SERVICE
45594680
ChargebackBreakdown:
45604681
description: Charges breakdown.
45614682
properties:
@@ -9335,6 +9456,125 @@ components:
93359456
example: Oh boy!
93369457
type: string
93379458
type: object
9459+
EventCategory:
9460+
description: Event category to identify the type of event. Only the value `change`
9461+
is supported. Support for other categories are coming. please reach out to
9462+
datadog support if you're interested.
9463+
enum:
9464+
- change
9465+
example: change
9466+
type: string
9467+
x-enum-varnames:
9468+
- CHANGE
9469+
EventCreateRequest:
9470+
description: Object representing an event creation request.
9471+
properties:
9472+
attributes:
9473+
$ref: '#/components/schemas/EventPayload'
9474+
type:
9475+
$ref: '#/components/schemas/EventCreateRequestType'
9476+
type: object
9477+
EventCreateRequestPayload:
9478+
description: Payload for creating an event.
9479+
properties:
9480+
data:
9481+
$ref: '#/components/schemas/EventCreateRequest'
9482+
type: object
9483+
EventCreateRequestType:
9484+
description: Entity type.
9485+
enum:
9486+
- event
9487+
example: event
9488+
type: string
9489+
x-enum-varnames:
9490+
- EVENT
9491+
EventCreateResponse:
9492+
description: Object containing an event response.
9493+
properties:
9494+
attributes:
9495+
$ref: '#/components/schemas/EventCreateResponseAttributes'
9496+
type:
9497+
description: Event type
9498+
example: event
9499+
type: string
9500+
type: object
9501+
EventCreateResponseAttributes:
9502+
description: JSON object containing all events attributes and their associated
9503+
values.
9504+
properties:
9505+
attributes:
9506+
$ref: '#/components/schemas/EventCreateResponseAttributesAttributes'
9507+
type: object
9508+
EventCreateResponseAttributesAttributes:
9509+
description: JSON object of attributes from your events.
9510+
properties:
9511+
evt:
9512+
$ref: '#/components/schemas/EventCreateResponseAttributesAttributesEvt'
9513+
type: object
9514+
EventCreateResponseAttributesAttributesEvt:
9515+
description: JSON object of event system attributes.
9516+
properties:
9517+
id:
9518+
description: Event id
9519+
type: string
9520+
type: object
9521+
EventCreateResponsePayload:
9522+
description: Response containing information about created event.
9523+
properties:
9524+
data:
9525+
$ref: '#/components/schemas/EventCreateResponse'
9526+
type: object
9527+
EventPayload:
9528+
description: Event attributes.
9529+
properties:
9530+
aggregation_key:
9531+
description: An arbitrary string to use for aggregation when correlating
9532+
events. Limited to 100 characters.
9533+
maxLength: 100
9534+
type: string
9535+
attributes:
9536+
$ref: '#/components/schemas/EventPayloadAttributes'
9537+
category:
9538+
$ref: '#/components/schemas/EventCategory'
9539+
message:
9540+
description: The body of the event. Limited to 4000 characters.
9541+
example: payment_processed feature flag has been enabled
9542+
maxLength: 4000
9543+
type: string
9544+
tags:
9545+
description: 'A list of tags to apply to the event.
9546+
9547+
Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).'
9548+
example:
9549+
- environment:test
9550+
items:
9551+
description: A tag.
9552+
type: string
9553+
type: array
9554+
timestamp:
9555+
description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
9556+
format.
9557+
9558+
For example `"2017-01-15T01:30:15.010000Z"`.
9559+
9560+
Defaults to the timestamp of receipt. Limited to values no older than
9561+
18 hours.'
9562+
type: string
9563+
title:
9564+
description: The event title. Limited to 500 characters.
9565+
example: payment_processed feature flag updated
9566+
maxLength: 500
9567+
type: string
9568+
required:
9569+
- title
9570+
- category
9571+
- attributes
9572+
type: object
9573+
EventPayloadAttributes:
9574+
description: JSON object for custom attributes. Schema are different per each
9575+
event category.
9576+
oneOf:
9577+
- $ref: '#/components/schemas/ChangeEventCustomAttributes'
93389578
EventPriority:
93399579
description: The priority of the event's monitor. For example, `normal` or `low`.
93409580
enum:
@@ -31191,6 +31431,44 @@ paths:
3119131431
operator: OR
3119231432
permissions:
3119331433
- events_read
31434+
post:
31435+
description: This endpoint allows you to post events. Only events with `change`
31436+
category are under General Availability.
31437+
operationId: CreateEvent
31438+
requestBody:
31439+
content:
31440+
application/json:
31441+
schema:
31442+
$ref: '#/components/schemas/EventCreateRequestPayload'
31443+
description: Event request object
31444+
required: true
31445+
responses:
31446+
'200':
31447+
content:
31448+
application/json:
31449+
schema:
31450+
$ref: '#/components/schemas/EventCreateResponsePayload'
31451+
description: OK
31452+
'400':
31453+
content:
31454+
application/json:
31455+
schema:
31456+
$ref: '#/components/schemas/JSONAPIErrorResponse'
31457+
description: Bad request
31458+
'403':
31459+
content:
31460+
application/json:
31461+
schema:
31462+
$ref: '#/components/schemas/JSONAPIErrorResponse'
31463+
description: Forbidden
31464+
'429':
31465+
$ref: '#/components/responses/TooManyRequestsResponse'
31466+
security:
31467+
- apiKeyAuth: []
31468+
summary: Post an event
31469+
tags:
31470+
- Events
31471+
x-codegen-request-body-name: body
3119431472
/api/v2/events/search:
3119531473
post:
3119631474
description: 'List endpoint returns events that match an events search query.

examples/v2/events/CreateEvent.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Post an event returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::EventsAPI.new
5+
6+
body = DatadogAPIClient::V2::EventCreateRequestPayload.new({
7+
data: DatadogAPIClient::V2::EventCreateRequest.new({
8+
attributes: DatadogAPIClient::V2::EventPayload.new({
9+
attributes: DatadogAPIClient::V2::ChangeEventCustomAttributes.new({
10+
author: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthor.new({
11+
12+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesAuthorType::USER,
13+
}),
14+
change_metadata: {
15+
"dd": "{'team': 'datadog_team', 'user_email': '[email protected]', 'user_id': 'datadog_user_id', 'user_name': 'datadog_username'}", "resource_link": "datadog.com/feature/fallback_payments_test",
16+
},
17+
changed_resource: DatadogAPIClient::V2::ChangeEventCustomAttributesChangedResource.new({
18+
name: "fallback_payments_test",
19+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesChangedResourceType::FEATURE_FLAG,
20+
}),
21+
impacted_resources: [
22+
DatadogAPIClient::V2::ChangeEventCustomAttributesImpactedResourcesItems.new({
23+
name: "payments_api",
24+
type: DatadogAPIClient::V2::ChangeEventCustomAttributesImpactedResourcesItemsType::SERVICE,
25+
}),
26+
],
27+
new_value: {
28+
"enabled": "True", "percentage": "50%", "rule": "{'datacenter': 'devcycle.us1.prod'}",
29+
},
30+
prev_value: {
31+
"enabled": "True", "percentage": "10%", "rule": "{'datacenter': 'devcycle.us1.prod'}",
32+
},
33+
}),
34+
category: DatadogAPIClient::V2::EventCategory::CHANGE,
35+
message: "payment_processed feature flag has been enabled",
36+
tags: [
37+
"environment:test",
38+
],
39+
title: "payment_processed feature flag updated",
40+
}),
41+
type: DatadogAPIClient::V2::EventCreateRequestType::EVENT,
42+
}),
43+
})
44+
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
@@ -1228,6 +1228,9 @@
12281228
"page_cursor" => "String",
12291229
"page_limit" => "Integer",
12301230
},
1231+
"v2.CreateEvent" => {
1232+
"body" => "EventCreateRequestPayload",
1233+
},
12311234
"v2.SearchEvents" => {
12321235
"body" => "EventsListRequest",
12331236
},

0 commit comments

Comments
 (0)