-
Notifications
You must be signed in to change notification settings - Fork 15
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 2340c8b7 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Oct 22, 2024
1 parent
56f96c2
commit 341e062
Showing
27 changed files
with
1,461 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3951,6 +3951,243 @@ components: | |
format: int64 | ||
type: integer | ||
type: object | ||
ChangeEvent: | ||
description: Event attributes. | ||
properties: | ||
aggregation_key: | ||
description: 'An arbitrary string to use for aggregation. Limited to 100 | ||
characters. | ||
|
||
If you specify a key, all events using that key are grouped together in | ||
the Event Stream.' | ||
maxLength: 100 | ||
type: string | ||
attributes: | ||
$ref: '#/components/schemas/ChangeEventCustomAttributes' | ||
category: | ||
$ref: '#/components/schemas/ChangeEventCategory' | ||
message: | ||
description: The body of the event. Limited to 4000 characters. | ||
example: payment_processed feature flag has been enabled | ||
maxLength: 4000 | ||
type: string | ||
tags: | ||
description: 'A list of tags to apply to the event. | ||
|
||
Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).' | ||
example: | ||
- environment:test | ||
items: | ||
description: A tag. | ||
type: string | ||
type: array | ||
timestamp: | ||
description: 'Timestamp in which the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) | ||
format. | ||
|
||
For example `"2017-01-15T01:30:15.010000Z"`. | ||
|
||
Defaults to now. Limited to values no older than 18 hours.' | ||
type: string | ||
title: | ||
description: The event title. Limited to 500 characters. | ||
example: payment_processed feature flag updated | ||
maxLength: 500 | ||
type: string | ||
required: | ||
- title | ||
- category | ||
- attributes | ||
type: object | ||
ChangeEventCategory: | ||
description: Event category to identify the type of event. Only the value `change` | ||
is supported. | ||
enum: | ||
- change | ||
example: change | ||
type: string | ||
x-enum-varnames: | ||
- CHANGE | ||
ChangeEventCreateRequest: | ||
description: Object representing an event. | ||
properties: | ||
attributes: | ||
$ref: '#/components/schemas/ChangeEvent' | ||
type: | ||
$ref: '#/components/schemas/ChangeEventCreateRequestType' | ||
type: object | ||
ChangeEventCreateRequestPayload: | ||
description: Create an event. | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/ChangeEventCreateRequest' | ||
type: object | ||
ChangeEventCreateRequestType: | ||
description: Entity type. | ||
enum: | ||
- event | ||
example: event | ||
type: string | ||
x-enum-varnames: | ||
- EVENT | ||
ChangeEventCreateResponse: | ||
description: Object containing an event response. | ||
properties: | ||
attributes: | ||
$ref: '#/components/schemas/ChangeEventCreateResponseAttributes' | ||
type: | ||
description: Event type | ||
example: event | ||
type: string | ||
type: object | ||
ChangeEventCreateResponseAttributes: | ||
description: Event response attributes. | ||
properties: | ||
attributes: | ||
$ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributes' | ||
type: object | ||
ChangeEventCreateResponseAttributesAttributes: | ||
description: The definition of `ChangeEventCreateResponseAttributesAttributes` | ||
object. | ||
properties: | ||
evt: | ||
$ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributesEvt' | ||
type: object | ||
ChangeEventCreateResponseAttributesAttributesEvt: | ||
description: The definition of `ChangeEventCreateResponseAttributesAttributesEvt` | ||
object. | ||
properties: | ||
id: | ||
description: Event id | ||
type: string | ||
type: object | ||
ChangeEventCreateResponsePayload: | ||
description: Response containing information about created event. | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/ChangeEventCreateResponse' | ||
type: object | ||
ChangeEventCustomAttributes: | ||
description: Object representing custom event attributes. | ||
properties: | ||
author: | ||
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthor' | ||
change_metadata: | ||
additionalProperties: {} | ||
description: Free form object with any related information of the `change` | ||
event. | ||
example: | ||
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 | ||
type: object | ||
changed_resource: | ||
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResource' | ||
impacted_resources: | ||
description: 'A list of resources impacted by this change. It is recommended | ||
to provide an impacted resource to display | ||
|
||
the change event at the right location. Only resources of type `service` | ||
are supported.' | ||
example: | ||
- name: payments_api | ||
type: service | ||
items: | ||
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems' | ||
type: array | ||
new_value: | ||
additionalProperties: {} | ||
description: Free form object to track new value of the changed resource. | ||
example: | ||
enabled: true | ||
percentage: 50% | ||
rule: | ||
datacenter: devcycle.us1.prod | ||
type: object | ||
prev_value: | ||
additionalProperties: {} | ||
description: Free form object to track previous value of the changed resource. | ||
example: | ||
enabled: true | ||
percentage: 10% | ||
rule: | ||
datacenter: devcycle.us1.prod | ||
type: object | ||
required: | ||
- changed_resource | ||
type: object | ||
ChangeEventCustomAttributesAuthor: | ||
description: Object representing the entity which made the change. Optional | ||
field but if provided should include `type` and `name`. | ||
properties: | ||
name: | ||
description: Author's name. Limited to 128 characters. | ||
example: [email protected] | ||
maxLength: 128 | ||
type: string | ||
type: | ||
$ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType' | ||
required: | ||
- name | ||
- type | ||
type: object | ||
ChangeEventCustomAttributesAuthorType: | ||
description: Author's type. | ||
enum: | ||
- user | ||
- system | ||
example: user | ||
type: string | ||
x-enum-varnames: | ||
- USER | ||
- SYSTEM | ||
ChangeEventCustomAttributesChangedResource: | ||
description: Object representing a uniquely identified resource. Only the resource | ||
type `feature_flag` is supported. | ||
properties: | ||
name: | ||
description: Resource's name. | ||
example: fallback_payments_test | ||
type: string | ||
type: | ||
$ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType' | ||
required: | ||
- type | ||
- name | ||
type: object | ||
ChangeEventCustomAttributesChangedResourceType: | ||
description: Resource's type. | ||
enum: | ||
- feature_flag | ||
example: feature_flag | ||
type: string | ||
x-enum-varnames: | ||
- FEATURE_FLAG | ||
ChangeEventCustomAttributesImpactedResourcesItems: | ||
description: Object representing a uniquely identified resource. Only the resource | ||
type `service` is supported. | ||
properties: | ||
name: | ||
description: Resource's name. | ||
example: payments_api | ||
type: string | ||
type: | ||
$ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType' | ||
required: | ||
- type | ||
- name | ||
type: object | ||
ChangeEventCustomAttributesImpactedResourcesItemsType: | ||
description: Resource's type. | ||
enum: | ||
- service | ||
example: service | ||
type: string | ||
x-enum-varnames: | ||
- SERVICE | ||
ChargebackBreakdown: | ||
description: Charges breakdown. | ||
properties: | ||
|
@@ -29663,6 +29900,47 @@ paths: | |
operator: OR | ||
permissions: | ||
- events_read | ||
post: | ||
description: This endpoint allows you to post events. Only events with `change` | ||
category are supported. | ||
operationId: CreateEvent | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/ChangeEventCreateRequestPayload' | ||
description: Event request object | ||
required: true | ||
responses: | ||
'200': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/ChangeEventCreateResponsePayload' | ||
description: OK | ||
'400': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/JSONAPIErrorResponse' | ||
description: Bad request | ||
'403': | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/JSONAPIErrorResponse' | ||
description: Forbidden | ||
'429': | ||
$ref: '#/components/responses/TooManyRequestsResponse' | ||
security: | ||
- apiKeyAuth: [] | ||
summary: Post a change event | ||
tags: | ||
- Events | ||
x-codegen-request-body-name: body | ||
x-unstable: '**Note**: This endpoint is in **Preview**. | ||
|
||
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' | ||
/api/v2/events/search: | ||
post: | ||
description: 'List endpoint returns events that match an events search query. | ||
|
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,62 @@ | ||
/** | ||
* Post a change event returns "OK" response | ||
*/ | ||
|
||
import { client, v2 } from "@datadog/datadog-api-client"; | ||
|
||
const configuration = client.createConfiguration(); | ||
configuration.unstableOperations["v2.createEvent"] = true; | ||
const apiInstance = new v2.EventsApi(configuration); | ||
|
||
const params: v2.EventsApiCreateEventRequest = { | ||
body: { | ||
data: { | ||
attributes: { | ||
attributes: { | ||
author: { | ||
name: "[email protected]", | ||
type: "user", | ||
}, | ||
changeMetadata: { | ||
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", | ||
}, | ||
changedResource: { | ||
name: "fallback_payments_test", | ||
type: "feature_flag", | ||
}, | ||
impactedResources: [ | ||
{ | ||
name: "payments_api", | ||
type: "service", | ||
}, | ||
], | ||
newValue: { | ||
enabled: "True", | ||
percentage: "50%", | ||
rule: "{'datacenter': 'devcycle.us1.prod'}", | ||
}, | ||
prevValue: { | ||
enabled: "True", | ||
percentage: "10%", | ||
rule: "{'datacenter': 'devcycle.us1.prod'}", | ||
}, | ||
}, | ||
category: "change", | ||
message: "payment_processed feature flag has been enabled", | ||
tags: ["environment:test"], | ||
title: "payment_processed feature flag updated", | ||
}, | ||
type: "event", | ||
}, | ||
}, | ||
}; | ||
|
||
apiInstance | ||
.createEvent(params) | ||
.then((data: v2.ChangeEventCreateResponsePayload) => { | ||
console.log( | ||
"API called successfully. Returned data: " + JSON.stringify(data) | ||
); | ||
}) | ||
.catch((error: any) => console.error(error)); |
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.