Skip to content

Commit 59dfdb3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 50aff559 of spec repo
1 parent a2fd973 commit 59dfdb3

File tree

10 files changed

+480
-7
lines changed

10 files changed

+480
-7
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-07-09 16:56:52.927222",
8-
"spec_repo_commit": "dff08f2a"
7+
"regenerated": "2024-07-10 13:25:00.973399",
8+
"spec_repo_commit": "50aff559"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-09 16:56:52.945992",
13-
"spec_repo_commit": "dff08f2a"
12+
"regenerated": "2024-07-10 13:25:00.991437",
13+
"spec_repo_commit": "50aff559"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14067,6 +14067,7 @@ components:
1406714067
required:
1406814068
- password
1406914069
- username
14070+
- type
1407014071
type: object
1407114072
SyntheticsBasicAuthDigestType:
1407214073
default: digest
@@ -14150,6 +14151,7 @@ components:
1415014151
- tokenApiAuthentication
1415114152
- clientId
1415214153
- clientSecret
14154+
- type
1415314155
type: object
1415414156
SyntheticsBasicAuthOauthClientType:
1415514157
default: oauth-client
@@ -14205,6 +14207,7 @@ components:
1420514207
- password
1420614208
- tokenApiAuthentication
1420714209
- username
14210+
- type
1420814211
type: object
1420914212
SyntheticsBasicAuthOauthROPType:
1421014213
default: oauth-rop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-07-05T12:58:17.908Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"log": {
3+
"_recordingName": "Synthetics/Create a multi-step api test with every type of basicAuth returns \"OK - Returns the created test details.\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "a67ddceb4394f93bfa261b93d44471af",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 2174,
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": 579,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"config\":{\"steps\":[{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"password\":\"password\",\"username\":\"username\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"password\":\"password\",\"type\":\"web\",\"username\":\"username\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"accessKey\":\"accessKey\",\"secretKey\":\"secretKey\",\"type\":\"sigv4\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"type\":\"ntlm\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"password\":\"password\",\"type\":\"digest\",\"username\":\"username\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"accessTokenUrl\",\"clientId\":\"clientId\",\"clientSecret\":\"clientSecret\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"accessTokenUrl\",\"password\":\"password\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-rop\",\"username\":\"username\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\"}]},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_test_multi_step_with_every_type_of_basic_auth.json\",\"name\":\"Test-Create_a_multi_step_api_test_with_every_type_of_basicAuth_returns_OK_Returns_the_created_test_detail-1720184297\",\"options\":{\"tick_every\":60},\"subtype\":\"multi\",\"type\":\"api\"}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/api"
39+
},
40+
"response": {
41+
"bodySize": 2687,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 2687,
45+
"text": "{\"public_id\":\"56p-u4n-28g\",\"name\":\"Test-Create_a_multi_step_api_test_with_every_type_of_basicAuth_returns_OK_Returns_the_created_test_detail-1720184297\",\"status\":\"live\",\"type\":\"api\",\"tags\":[],\"created_at\":\"2024-07-05T12:58:18.584903+00:00\",\"modified_at\":\"2024-07-05T12:58:18.584903+00:00\",\"config\":{\"steps\":[{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"password\":\"password\",\"username\":\"username\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\",\"id\":\"ff5-wjd-ccw\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"password\":\"password\",\"type\":\"web\",\"username\":\"username\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\",\"id\":\"db3-du3-8gk\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"accessKey\":\"accessKey\",\"secretKey\":\"secretKey\",\"type\":\"sigv4\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\",\"id\":\"3f9-7ax-tft\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"type\":\"ntlm\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\",\"id\":\"aid-ufz-avb\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"password\":\"password\",\"type\":\"digest\",\"username\":\"username\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\",\"id\":\"y54-ebw-t9y\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"accessTokenUrl\",\"clientId\":\"clientId\",\"clientSecret\":\"clientSecret\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\",\"id\":\"kt9-j8b-s5x\"},{\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"name\":\"request is sent\",\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"accessTokenUrl\",\"password\":\"password\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-rop\",\"username\":\"username\"},\"method\":\"GET\",\"url\":\"https://httpbin.org/status/200\"},\"subtype\":\"http\",\"id\":\"ump-bpw-fa4\"}]},\"message\":\"BDD test payload: synthetics_api_test_multi_step_with_every_type_of_basic_auth.json\",\"options\":{\"tick_every\":60},\"locations\":[\"aws:us-east-2\"],\"subtype\":\"multi\",\"created_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":148635778,\"org_id\":321813,\"modified_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"}}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 663,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2024-07-05T12:58:17.918Z",
61+
"time": 744
62+
},
63+
{
64+
"_id": "98e96e8aa4ad08ac8aae4b7c279ce4f0",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 30,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
},
76+
{
77+
"_fromType": "array",
78+
"name": "content-type",
79+
"value": "application/json"
80+
}
81+
],
82+
"headersSize": 568,
83+
"httpVersion": "HTTP/1.1",
84+
"method": "POST",
85+
"postData": {
86+
"mimeType": "application/json",
87+
"params": [],
88+
"text": "{\"public_ids\":[\"56p-u4n-28g\"]}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/delete"
92+
},
93+
"response": {
94+
"bodySize": 96,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 96,
98+
"text": "{\"deleted_tests\":[{\"public_id\":\"56p-u4n-28g\",\"deleted_at\":\"2024-07-05T12:58:19.277853+00:00\"}]}\n"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 662,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 200,
111+
"statusText": "OK"
112+
},
113+
"startedDateTime": "2024-07-05T12:58:18.673Z",
114+
"time": 956
115+
}
116+
],
117+
"pages": [],
118+
"version": "1.2"
119+
}
120+
}
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
/**
2+
* Create a multi-step api test with every type of basicAuth returns "OK - Returns the created test details." response
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.SyntheticsApi(configuration);
9+
10+
const params: v1.SyntheticsApiCreateSyntheticsAPITestRequest = {
11+
body: {
12+
config: {
13+
steps: [
14+
{
15+
assertions: [
16+
{
17+
operator: "is",
18+
type: "statusCode",
19+
target: 200,
20+
},
21+
],
22+
name: "request is sent",
23+
request: {
24+
url: "https://httpbin.org/status/200",
25+
method: "GET",
26+
basicAuth: {
27+
password: "password",
28+
username: "username",
29+
},
30+
},
31+
subtype: "http",
32+
},
33+
{
34+
assertions: [
35+
{
36+
operator: "is",
37+
type: "statusCode",
38+
target: 200,
39+
},
40+
],
41+
name: "request is sent",
42+
request: {
43+
url: "https://httpbin.org/status/200",
44+
method: "GET",
45+
basicAuth: {
46+
password: "password",
47+
username: "username",
48+
type: "web",
49+
},
50+
},
51+
subtype: "http",
52+
},
53+
{
54+
assertions: [
55+
{
56+
operator: "is",
57+
type: "statusCode",
58+
target: 200,
59+
},
60+
],
61+
name: "request is sent",
62+
request: {
63+
url: "https://httpbin.org/status/200",
64+
method: "GET",
65+
basicAuth: {
66+
accessKey: "accessKey",
67+
secretKey: "secretKey",
68+
type: "sigv4",
69+
},
70+
},
71+
subtype: "http",
72+
},
73+
{
74+
assertions: [
75+
{
76+
operator: "is",
77+
type: "statusCode",
78+
target: 200,
79+
},
80+
],
81+
name: "request is sent",
82+
request: {
83+
url: "https://httpbin.org/status/200",
84+
method: "GET",
85+
basicAuth: {
86+
type: "ntlm",
87+
},
88+
},
89+
subtype: "http",
90+
},
91+
{
92+
assertions: [
93+
{
94+
operator: "is",
95+
type: "statusCode",
96+
target: 200,
97+
},
98+
],
99+
name: "request is sent",
100+
request: {
101+
url: "https://httpbin.org/status/200",
102+
method: "GET",
103+
basicAuth: {
104+
password: "password",
105+
username: "username",
106+
type: "digest",
107+
},
108+
},
109+
subtype: "http",
110+
},
111+
{
112+
assertions: [
113+
{
114+
operator: "is",
115+
type: "statusCode",
116+
target: 200,
117+
},
118+
],
119+
name: "request is sent",
120+
request: {
121+
url: "https://httpbin.org/status/200",
122+
method: "GET",
123+
basicAuth: {
124+
accessTokenUrl: "accessTokenUrl",
125+
tokenApiAuthentication: "header",
126+
clientId: "clientId",
127+
clientSecret: "clientSecret",
128+
type: "oauth-client",
129+
},
130+
},
131+
subtype: "http",
132+
},
133+
{
134+
assertions: [
135+
{
136+
operator: "is",
137+
type: "statusCode",
138+
target: 200,
139+
},
140+
],
141+
name: "request is sent",
142+
request: {
143+
url: "https://httpbin.org/status/200",
144+
method: "GET",
145+
basicAuth: {
146+
accessTokenUrl: "accessTokenUrl",
147+
password: "password",
148+
tokenApiAuthentication: "header",
149+
username: "username",
150+
type: "oauth-rop",
151+
},
152+
},
153+
subtype: "http",
154+
},
155+
],
156+
},
157+
locations: ["aws:us-east-2"],
158+
message:
159+
"BDD test payload: synthetics_api_test_multi_step_with_every_type_of_basic_auth.json",
160+
name: "Example-Synthetic",
161+
options: {
162+
tickEvery: 60,
163+
},
164+
subtype: "multi",
165+
type: "api",
166+
},
167+
};
168+
169+
apiInstance
170+
.createSyntheticsAPITest(params)
171+
.then((data: v1.SyntheticsAPITest) => {
172+
console.log(
173+
"API called successfully. Returned data: " + JSON.stringify(data)
174+
);
175+
})
176+
.catch((error: any) => console.error(error));

features/v1/synthetics.feature

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,21 @@ Feature: Synthetics
100100
When the request is sent
101101
Then the response status is 200 OK
102102

103+
@team:DataDog/synthetics-ct
104+
Scenario: Create a multi-step api test with every type of basicAuth returns "OK - Returns the created test details." response
105+
Given new "CreateSyntheticsAPITest" request
106+
And body from file "synthetics_api_test_multi_step_with_every_type_of_basic_auth.json"
107+
When the request is sent
108+
Then the response status is 200 OK - Returns the created test details.
109+
And the response "name" is equal to "{{ unique }}"
110+
And the response "config.steps[0].request.basicAuth" is equal to {"password": "password", "username": "username"}
111+
And the response "config.steps[1].request.basicAuth.type" is equal to "web"
112+
And the response "config.steps[2].request.basicAuth.type" is equal to "sigv4"
113+
And the response "config.steps[3].request.basicAuth.type" is equal to "ntlm"
114+
And the response "config.steps[4].request.basicAuth.type" is equal to "digest"
115+
And the response "config.steps[5].request.basicAuth.type" is equal to "oauth-client"
116+
And the response "config.steps[6].request.basicAuth.type" is equal to "oauth-rop"
117+
103118
@replay-only @team:DataDog/synthetics-ct
104119
Scenario: Create a private location returns "OK" response
105120
Given there is a valid "role" in the system

0 commit comments

Comments
 (0)