Skip to content

Commit e3f0a20

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add domain allowlist endpoints (#1878)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 22711d6 commit e3f0a20

File tree

21 files changed

+1048
-4
lines changed

21 files changed

+1048
-4
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-29 20:46:34.730777",
8-
"spec_repo_commit": "c0b9551e"
7+
"regenerated": "2024-10-30 18:58:11.764801",
8+
"spec_repo_commit": "755120dd"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-29 20:46:34.748934",
13-
"spec_repo_commit": "c0b9551e"
12+
"regenerated": "2024-10-30 18:58:11.783283",
13+
"spec_repo_commit": "755120dd"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7115,6 +7115,81 @@ components:
71157115
description: The type of the resource. The value should always be device.
71167116
type: string
71177117
type: object
7118+
DomainAllowlist:
7119+
description: The email domain allowlist for an org.
7120+
properties:
7121+
attributes:
7122+
$ref: '#/components/schemas/DomainAllowlistAttributes'
7123+
id:
7124+
description: The unique identifier of the org.
7125+
nullable: true
7126+
type: string
7127+
type:
7128+
$ref: '#/components/schemas/DomainAllowlistType'
7129+
required:
7130+
- type
7131+
type: object
7132+
DomainAllowlistAttributes:
7133+
description: The details of the email domain allowlist.
7134+
properties:
7135+
domains:
7136+
description: The list of domains in the email domain allowlist.
7137+
items:
7138+
type: string
7139+
type: array
7140+
enabled:
7141+
description: Whether the email domain allowlist is enabled for the org.
7142+
type: boolean
7143+
type: object
7144+
DomainAllowlistRequest:
7145+
description: Request containing the desired email domain allowlist configuration.
7146+
properties:
7147+
data:
7148+
$ref: '#/components/schemas/DomainAllowlist'
7149+
required:
7150+
- data
7151+
type: object
7152+
DomainAllowlistResponse:
7153+
description: Response containing information about the email domain allowlist.
7154+
properties:
7155+
data:
7156+
$ref: '#/components/schemas/DomainAllowlistResponseData'
7157+
type: object
7158+
DomainAllowlistResponseData:
7159+
description: The email domain allowlist response for an org.
7160+
properties:
7161+
attributes:
7162+
$ref: '#/components/schemas/DomainAllowlistResponseDataAttributes'
7163+
id:
7164+
description: The unique identifier of the org.
7165+
nullable: true
7166+
type: string
7167+
type:
7168+
$ref: '#/components/schemas/DomainAllowlistType'
7169+
required:
7170+
- type
7171+
type: object
7172+
DomainAllowlistResponseDataAttributes:
7173+
description: The details of the email domain allowlist.
7174+
properties:
7175+
domains:
7176+
description: The list of domains in the email domain allowlist.
7177+
items:
7178+
type: string
7179+
type: array
7180+
enabled:
7181+
description: Whether the email domain allowlist is enabled for the org.
7182+
type: boolean
7183+
type: object
7184+
DomainAllowlistType:
7185+
default: domain_allowlist
7186+
description: Email domain allowlist allowlist type.
7187+
enum:
7188+
- domain_allowlist
7189+
example: domain_allowlist
7190+
type: string
7191+
x-enum-varnames:
7192+
- DOMAIN_ALLOWLIST
71187193
DowntimeCreateRequest:
71197194
description: Request for creating a downtime.
71207195
properties:
@@ -29433,6 +29508,61 @@ paths:
2943329508
tags:
2943429509
- Dashboard Lists
2943529510
x-codegen-request-body-name: body
29511+
/api/v2/domain_allowlist:
29512+
get:
29513+
description: Get the domain allowlist for an organization.
29514+
operationId: GetDomainAllowlist
29515+
responses:
29516+
'200':
29517+
content:
29518+
application/json:
29519+
schema:
29520+
$ref: '#/components/schemas/DomainAllowlistResponse'
29521+
description: OK
29522+
'429':
29523+
$ref: '#/components/responses/TooManyRequestsResponse'
29524+
security:
29525+
- apiKeyAuth: []
29526+
appKeyAuth: []
29527+
- AuthZ:
29528+
- org_management
29529+
summary: Get Domain Allowlist
29530+
tags:
29531+
- Domain Allowlist
29532+
x-permission:
29533+
operator: OR
29534+
permissions:
29535+
- org_management
29536+
patch:
29537+
description: Update the domain allowlist for an organization.
29538+
operationId: PatchDomainAllowlist
29539+
requestBody:
29540+
content:
29541+
application/json:
29542+
schema:
29543+
$ref: '#/components/schemas/DomainAllowlistRequest'
29544+
required: true
29545+
responses:
29546+
'200':
29547+
content:
29548+
application/json:
29549+
schema:
29550+
$ref: '#/components/schemas/DomainAllowlistResponse'
29551+
description: OK
29552+
'429':
29553+
$ref: '#/components/responses/TooManyRequestsResponse'
29554+
security:
29555+
- apiKeyAuth: []
29556+
appKeyAuth: []
29557+
- AuthZ:
29558+
- org_management
29559+
summary: Sets Domain Allowlist
29560+
tags:
29561+
- Domain Allowlist
29562+
x-permission:
29563+
operator: OR
29564+
permissions:
29565+
- org_management
2943629566
/api/v2/dora/deployment:
2943729567
post:
2943829568
description: 'Use this API endpoint to provide data about deployments for DORA
@@ -41786,6 +41916,14 @@ tags:
4178641916

4178741917
organization.'
4178841918
name: Dashboard Lists
41919+
- description: 'Configure your Datadog Email Domain Allowlist directly through the
41920+
Datadog API.
41921+
41922+
The Email Domain Allowlist controls the domains that certain datadog emails can
41923+
be sent to.
41924+
41925+
For more information, see the [Domain Allowlist docs page](https://docs.datadoghq.com/account_management/org_settings/domain_allowlist)'
41926+
name: Domain Allowlist
4178941927
- description: '**Note**: Downtime V2 is currently in private beta. To request access,
4179041928
contact [Datadog support](https://docs.datadoghq.com/help/).
4179141929

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-10-23T18:16:16.668Z"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"log": {
3+
"_recordingName": "Domain Allowlist/Get Domain Allowlist returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "ef25ca5c7248f1ce0d700b9c841b7279",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 0,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
}
23+
],
24+
"headersSize": 515,
25+
"httpVersion": "HTTP/1.1",
26+
"method": "GET",
27+
"queryString": [],
28+
"url": "https://api.datadoghq.com/api/v2/domain_allowlist"
29+
},
30+
"response": {
31+
"bodySize": 107,
32+
"content": {
33+
"mimeType": "application/json",
34+
"size": 107,
35+
"text": "{\"data\":{\"type\":\"domain_allowlist\",\"attributes\":{\"enabled\":false,\"domains\":[\"@static-test-domain.test\"]}}}\n"
36+
},
37+
"cookies": [],
38+
"headers": [
39+
{
40+
"name": "content-type",
41+
"value": "application/json"
42+
}
43+
],
44+
"headersSize": 655,
45+
"httpVersion": "HTTP/1.1",
46+
"redirectURL": "",
47+
"status": 200,
48+
"statusText": "OK"
49+
},
50+
"startedDateTime": "2024-10-23T18:16:16.677Z",
51+
"time": 228
52+
}
53+
],
54+
"pages": [],
55+
"version": "1.2"
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-10-23T18:16:16.928Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"log": {
3+
"_recordingName": "Domain Allowlist/Sets Domain Allowlist returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "a389d9f3b7a7111e6014fd052f8b33d1",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 106,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 572,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "PATCH",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"domains\":[\"@static-test-domain.test\"],\"enabled\":false},\"type\":\"domain_allowlist\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/domain_allowlist"
39+
},
40+
"response": {
41+
"bodySize": 107,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 107,
45+
"text": "{\"data\":{\"type\":\"domain_allowlist\",\"attributes\":{\"enabled\":false,\"domains\":[\"@static-test-domain.test\"]}}}\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 655,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2024-10-23T18:16:16.933Z",
61+
"time": 183
62+
}
63+
],
64+
"pages": [],
65+
"version": "1.2"
66+
}
67+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Get Domain Allowlist returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.DomainAllowlistApi(configuration);
9+
10+
apiInstance
11+
.getDomainAllowlist()
12+
.then((data: v2.DomainAllowlistResponse) => {
13+
console.log(
14+
"API called successfully. Returned data: " + JSON.stringify(data)
15+
);
16+
})
17+
.catch((error: any) => console.error(error));
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Sets Domain Allowlist returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.DomainAllowlistApi(configuration);
9+
10+
const params: v2.DomainAllowlistApiPatchDomainAllowlistRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
domains: ["@static-test-domain.test"],
15+
enabled: false,
16+
},
17+
type: "domain_allowlist",
18+
},
19+
},
20+
};
21+
22+
apiInstance
23+
.patchDomainAllowlist(params)
24+
.then((data: v2.DomainAllowlistResponse) => {
25+
console.log(
26+
"API called successfully. Returned data: " + JSON.stringify(data)
27+
);
28+
})
29+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3352,6 +3352,16 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
33523352
},
33533353
"operationResponseType": "DashboardListUpdateItemsResponse",
33543354
},
3355+
"v2.GetDomainAllowlist": {
3356+
"operationResponseType": "DomainAllowlistResponse",
3357+
},
3358+
"v2.PatchDomainAllowlist": {
3359+
"body": {
3360+
"type": "DomainAllowlistRequest",
3361+
"format": "",
3362+
},
3363+
"operationResponseType": "DomainAllowlistResponse",
3364+
},
33553365
"v2.CreateDORADeployment": {
33563366
"body": {
33573367
"type": "DORADeploymentRequest",

0 commit comments

Comments
 (0)