Skip to content

Commit c37c5c6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 7fcb0871 of spec repo
1 parent 9ca8ca2 commit c37c5c6

File tree

14 files changed

+654
-6
lines changed

14 files changed

+654
-6
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": "2023-11-14 15:18:14.889333",
8-
"spec_repo_commit": "b95546fe"
7+
"regenerated": "2023-11-15 14:38:06.942082",
8+
"spec_repo_commit": "7fcb0871"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-11-14 15:18:14.904239",
13-
"spec_repo_commit": "b95546fe"
12+
"regenerated": "2023-11-15 14:38:06.962169",
13+
"spec_repo_commit": "7fcb0871"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14705,6 +14705,55 @@ components:
1470514705
type:
1470614706
$ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptionsType'
1470714707
type: object
14708+
SyntheticsPatchTestBody:
14709+
description: Wrapper around an array of [JSON Patch](https://jsonpatch.com)
14710+
operations to perform on the test
14711+
properties:
14712+
data:
14713+
description: Array of [JSON Patch](https://jsonpatch.com) operations to
14714+
perform on the test
14715+
example:
14716+
- op: replace
14717+
path: /name
14718+
value: New test name
14719+
- op: remove
14720+
path: /config/assertion/0
14721+
items:
14722+
$ref: '#/components/schemas/SyntheticsPatchTestOperation'
14723+
type: array
14724+
type: object
14725+
SyntheticsPatchTestOperation:
14726+
description: A single [JSON Patch](https://jsonpatch.com) operation to perform
14727+
on the test
14728+
properties:
14729+
op:
14730+
$ref: '#/components/schemas/SyntheticsPatchTestOperationName'
14731+
path:
14732+
description: The path to the value to modify
14733+
example: /name
14734+
type: string
14735+
value:
14736+
description: A value to use in a [JSON Patch](https://jsonpatch.com) operation
14737+
example: New Test Name
14738+
type: object
14739+
SyntheticsPatchTestOperationName:
14740+
description: The operation to perform
14741+
enum:
14742+
- add
14743+
- remove
14744+
- replace
14745+
- move
14746+
- copy
14747+
- test
14748+
example: replace
14749+
type: string
14750+
x-enum-varnames:
14751+
- ADD
14752+
- REMOVE
14753+
- REPLACE
14754+
- MOVE
14755+
- COPY
14756+
- TEST
1470814757
SyntheticsPlayingTab:
1470914758
description: Navigate between different tabs for your browser test.
1471014759
enum:
@@ -29650,7 +29699,7 @@ paths:
2965029699
description: Edit the configuration of a Synthetic browser test.
2965129700
operationId: UpdateBrowserTest
2965229701
parameters:
29653-
- description: The public ID of the test to get details from.
29702+
- description: The public ID of the test to edit.
2965429703
in: path
2965529704
name: public_id
2965629705
required: true
@@ -29989,6 +30038,60 @@ paths:
2998930038
summary: Get a test configuration
2999030039
tags:
2999130040
- Synthetics
30041+
patch:
30042+
description: Patch the configuration of a Synthetic test with partial data.
30043+
operationId: PatchTest
30044+
parameters:
30045+
- description: The public ID of the test to patch.
30046+
in: path
30047+
name: public_id
30048+
required: true
30049+
schema:
30050+
type: string
30051+
requestBody:
30052+
content:
30053+
application/json:
30054+
schema:
30055+
$ref: '#/components/schemas/SyntheticsPatchTestBody'
30056+
description: '[JSON Patch](https://jsonpatch.com/) compliant list of operations'
30057+
required: true
30058+
responses:
30059+
'200':
30060+
content:
30061+
application/json:
30062+
schema:
30063+
$ref: '#/components/schemas/SyntheticsTestDetails'
30064+
description: OK
30065+
'400':
30066+
content:
30067+
application/json:
30068+
schema:
30069+
$ref: '#/components/schemas/APIErrorResponse'
30070+
description: '- JSON format is wrong
30071+
30072+
- Updating sub-type is forbidden'
30073+
'403':
30074+
content:
30075+
application/json:
30076+
schema:
30077+
$ref: '#/components/schemas/APIErrorResponse'
30078+
description: Forbidden
30079+
'404':
30080+
content:
30081+
application/json:
30082+
schema:
30083+
$ref: '#/components/schemas/APIErrorResponse'
30084+
description: '- Synthetic Monitoring is not activated for the user
30085+
30086+
- Test is not owned by the user
30087+
30088+
- Test can''t be found'
30089+
'429':
30090+
$ref: '#/components/responses/TooManyRequestsResponse'
30091+
summary: Patch a Synthetics test
30092+
tags:
30093+
- Synthetics
30094+
x-codegen-request-body-name: body
2999230095
/api/v1/synthetics/tests/{public_id}/results:
2999330096
get:
2999430097
description: Get the last 150 test results summaries for a given Synthetic API
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2023-11-15T14:03:15.532Z"
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
{
2+
"log": {
3+
"_recordingName": "Synthetics/Patch a Synthetics test returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "f9d8650ec900c6fa292155326865e30e",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 1721,
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\":{\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"target\":\"text/html\",\"type\":\"header\"},{\"operator\":\"lessThan\",\"target\":2000,\"timingsScope\":\"withoutDNS\",\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"scope\":\"yoyo\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"certificate\":{\"cert\":{\"content\":\"cert-content\",\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"content\":\"key-content\",\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testpatchasyntheticstestreturnsokresponse1700056995\"},\"method\":\"GET\",\"persistCookies\":true,\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"}},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"name\":\"Test-Patch_a_Synthetics_test_returns_OK_response-1700056995\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"httpVersion\":\"http2\",\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Patch_a_Synthetics_test_returns_OK_response-1700056995\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"subtype\":\"http\",\"tags\":[\"testing:api\"],\"type\":\"api\"}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/api"
39+
},
40+
"response": {
41+
"bodySize": 2046,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 2046,
45+
"text": "{\"public_id\":\"j7s-9tj-9m5\",\"name\":\"Test-Patch_a_Synthetics_test_returns_OK_response-1700056995\",\"status\":\"live\",\"type\":\"api\",\"tags\":[\"testing:api\"],\"created_at\":\"2023-11-15T14:03:16.148685+00:00\",\"modified_at\":\"2023-11-15T14:03:16.148685+00:00\",\"config\":{\"assertions\":[{\"operator\":\"is\",\"property\":\"{{ PROPERTY }}\",\"target\":\"text/html\",\"type\":\"header\"},{\"operator\":\"lessThan\",\"target\":2000,\"timingsScope\":\"withoutDNS\",\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"scope\":\"yoyo\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"certificate\":{\"cert\":{\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testpatchasyntheticstestreturnsokresponse1700056995\"},\"method\":\"GET\",\"persistCookies\":true,\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"}},\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"httpVersion\":\"http2\",\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Patch_a_Synthetics_test_returns_OK_response-1700056995\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"locations\":[\"aws:us-east-2\"],\"subtype\":\"http\",\"created_by\":{\"name\":\"Frog\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":134858209,\"org_id\":569509,\"modified_by\":{\"name\":\"Frog\",\"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": "2023-11-15T14:03:15.543Z",
61+
"time": 699
62+
},
63+
{
64+
"_id": "8dc1ede64fcbb7650e126d772a1b690b",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 112,
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": 573,
83+
"httpVersion": "HTTP/1.1",
84+
"method": "PATCH",
85+
"postData": {
86+
"mimeType": "application/json",
87+
"params": [],
88+
"text": "{\"data\":[{\"op\":\"replace\",\"path\":\"/name\",\"value\":\"New test name\"},{\"op\":\"remove\",\"path\":\"/config/assertions/0\"}]}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/j7s-9tj-9m5"
92+
},
93+
"response": {
94+
"bodySize": 1917,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 1917,
98+
"text": "{\"public_id\":\"j7s-9tj-9m5\",\"name\":\"New test name\",\"status\":\"live\",\"type\":\"api\",\"tags\":[\"testing:api\"],\"created_at\":\"2023-11-15T14:03:16.148685+00:00\",\"modified_at\":\"2023-11-15T14:03:16.871219+00:00\",\"config\":{\"assertions\":[{\"operator\":\"lessThan\",\"target\":2000,\"timingsScope\":\"withoutDNS\",\"type\":\"responseTime\"},{\"operator\":\"validatesJSONPath\",\"target\":{\"jsonPath\":\"topKey\",\"operator\":\"isNot\",\"targetValue\":\"0\"},\"type\":\"body\"},{\"operator\":\"validatesXPath\",\"target\":{\"operator\":\"contains\",\"targetValue\":\"0\",\"xPath\":\"target-xpath\"},\"type\":\"body\"}],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"basicAuth\":{\"accessTokenUrl\":\"https://datadog-token.com\",\"audience\":\"audience\",\"clientId\":\"client-id\",\"clientSecret\":\"client-secret\",\"resource\":\"resource\",\"scope\":\"yoyo\",\"tokenApiAuthentication\":\"header\",\"type\":\"oauth-client\"},\"certificate\":{\"key\":{\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"cert\":{\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"headers\":{\"unique\":\"testpatchasyntheticstestreturnsokresponse1700056995\"},\"method\":\"GET\",\"persistCookies\":true,\"proxy\":{\"headers\":{},\"url\":\"https://datadoghq.com\"},\"timeout\":10,\"url\":\"https://datadoghq.com\"}},\"message\":\"BDD test payload: synthetics_api_http_test_payload.json\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"httpVersion\":\"http2\",\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Patch_a_Synthetics_test_returns_OK_response-1700056995\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"locations\":[\"aws:us-east-2\"],\"subtype\":\"http\",\"created_by\":{\"name\":\"Frog\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":134858209,\"org_id\":569509,\"modified_by\":{\"name\":\"Frog\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"}}"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 657,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 200,
111+
"statusText": "OK"
112+
},
113+
"startedDateTime": "2023-11-15T14:03:16.249Z",
114+
"time": 728
115+
},
116+
{
117+
"_id": "ca0f2debce7278adb8440fc5db2b2ae5",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 30,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "application/json"
128+
},
129+
{
130+
"_fromType": "array",
131+
"name": "content-type",
132+
"value": "application/json"
133+
}
134+
],
135+
"headersSize": 568,
136+
"httpVersion": "HTTP/1.1",
137+
"method": "POST",
138+
"postData": {
139+
"mimeType": "application/json",
140+
"params": [],
141+
"text": "{\"public_ids\":[\"j7s-9tj-9m5\"]}"
142+
},
143+
"queryString": [],
144+
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/delete"
145+
},
146+
"response": {
147+
"bodySize": 96,
148+
"content": {
149+
"mimeType": "application/json",
150+
"size": 96,
151+
"text": "{\"deleted_tests\":[{\"public_id\":\"j7s-9tj-9m5\",\"deleted_at\":\"2023-11-15T14:03:17.553122+00:00\"}]}\n"
152+
},
153+
"cookies": [],
154+
"headers": [
155+
{
156+
"name": "content-type",
157+
"value": "application/json"
158+
}
159+
],
160+
"headersSize": 662,
161+
"httpVersion": "HTTP/1.1",
162+
"redirectURL": "",
163+
"status": 200,
164+
"statusText": "OK"
165+
},
166+
"startedDateTime": "2023-11-15T14:03:16.993Z",
167+
"time": 661
168+
}
169+
],
170+
"pages": [],
171+
"version": "1.2"
172+
}
173+
}

examples/v1/synthetics/PatchTest.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Patch a Synthetics test returns "OK" 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+
// there is a valid "synthetics_api_test" in the system
11+
const SYNTHETICS_API_TEST_PUBLIC_ID = process.env
12+
.SYNTHETICS_API_TEST_PUBLIC_ID as string;
13+
14+
const params: v1.SyntheticsApiPatchTestRequest = {
15+
body: {
16+
data: [
17+
{
18+
op: "replace",
19+
path: "/name",
20+
value: "New test name",
21+
},
22+
{
23+
op: "remove",
24+
path: "/config/assertions/0",
25+
},
26+
],
27+
},
28+
publicId: SYNTHETICS_API_TEST_PUBLIC_ID,
29+
};
30+
31+
apiInstance
32+
.patchTest(params)
33+
.then((data: v1.SyntheticsTestDetails) => {
34+
console.log(
35+
"API called successfully. Returned data: " + JSON.stringify(data)
36+
);
37+
})
38+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
21172117
},
21182118
"operationResponseType": "SyntheticsTestDetails",
21192119
},
2120+
"v1.PatchTest": {
2121+
"publicId": {
2122+
"type": "string",
2123+
"format": "",
2124+
},
2125+
"body": {
2126+
"type": "SyntheticsPatchTestBody",
2127+
"format": "",
2128+
},
2129+
"operationResponseType": "SyntheticsTestDetails",
2130+
},
21202131
"v1.GetAPITestLatestResults": {
21212132
"publicId": {
21222133
"type": "string",

0 commit comments

Comments
 (0)