Skip to content

Commit ec6cb44

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9b7c8967 of spec repo
1 parent 6c555d4 commit ec6cb44

File tree

13 files changed

+505
-9
lines changed

13 files changed

+505
-9
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-04-04 19:22:22.387463",
8-
"spec_repo_commit": "fd06108d"
7+
"regenerated": "2024-04-05 17:05:16.833733",
8+
"spec_repo_commit": "9b7c8967"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-04-04 19:22:22.408419",
13-
"spec_repo_commit": "fd06108d"
12+
"regenerated": "2024-04-05 17:05:16.851932",
13+
"spec_repo_commit": "9b7c8967"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15871,6 +15871,11 @@ components:
1587115871
maximum: 65535
1587215872
minimum: 1
1587315873
type: integer
15874+
files:
15875+
description: Files to be used as part of the request in the test.
15876+
items:
15877+
$ref: '#/components/schemas/SyntheticsTestRequestBodyFile'
15878+
type: array
1587415879
follow_redirects:
1587515880
description: Specifies whether or not the request follows redirects.
1587615881
type: boolean
@@ -15937,6 +15942,32 @@ components:
1593715942
example: https://example.com
1593815943
type: string
1593915944
type: object
15945+
SyntheticsTestRequestBodyFile:
15946+
description: Object describing a file to be used as part of the request in the
15947+
test.
15948+
properties:
15949+
bucketKey:
15950+
description: Bucket key of the file.
15951+
type: string
15952+
content:
15953+
description: Content of the file.
15954+
maxLength: 3145728
15955+
type: string
15956+
name:
15957+
description: Name of the file.
15958+
maxLength: 1500
15959+
type: string
15960+
size:
15961+
description: Size of the file.
15962+
format: int64
15963+
maximum: 3145728
15964+
minimum: 1
15965+
type: integer
15966+
type:
15967+
description: Type of the file.
15968+
maxLength: 1500
15969+
type: string
15970+
type: object
1594015971
SyntheticsTestRequestBodyType:
1594115972
description: Type of the request body.
1594215973
enum:
@@ -15946,6 +15977,8 @@ components:
1594615977
- text/html
1594715978
- application/x-www-form-urlencoded
1594815979
- graphql
15980+
- application/octet-stream
15981+
- multipart/form-data
1594915982
example: text/plain
1595015983
type: string
1595115984
x-enum-varnames:
@@ -15955,6 +15988,8 @@ components:
1595515988
- TEXT_HTML
1595615989
- APPLICATION_X_WWW_FORM_URLENCODED
1595715990
- GRAPHQL
15991+
- APPLICATION_OCTET_STREAM
15992+
- MULTIPART_FORM_DATA
1595815993
SyntheticsTestRequestCertificate:
1595915994
description: Client certificate to use when performing the test request.
1596015995
properties:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-04-02T15:35:39.188Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"log": {
3+
"_recordingName": "Synthetics/Create an API test with a file payload 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": "beb59fb44cd488796fd2f4a99885da2d",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 1969,
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\"},\"bodyType\":\"application/octet-stream\",\"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\"}},\"files\":[{\"content\":\"file content\",\"name\":\"file name\",\"type\":\"file type\"}],\"headers\":{\"unique\":\"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1712072139\"},\"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-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1712072139\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"httpVersion\":\"http2\",\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1712072139\",\"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": 2376,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 2376,
45+
"text": "{\"public_id\":\"sxp-kz5-mk7\",\"name\":\"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1712072139\",\"status\":\"live\",\"type\":\"api\",\"tags\":[\"testing:api\"],\"created_at\":\"2024-04-02T15:35:40.509801+00:00\",\"modified_at\":\"2024-04-02T15:35:40.509801+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\"},\"bodyType\":\"application/octet-stream\",\"certificate\":{\"cert\":{\"filename\":\"cert-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"},\"key\":{\"filename\":\"key-filename\",\"updatedAt\":\"2020-10-16T09:23:24.857Z\"}},\"files\":[{\"name\":\"file name\",\"type\":\"file type\",\"bucketKey\":\"api-upload-file/sxp-kz5-mk7/2024-04-02T15:35:40.363501_da19b48f-1756-453d-a03d-90526e629d7e.json\"}],\"headers\":{\"unique\":\"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1712072139\"},\"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-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1712072139\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":10},\"tick_every\":60},\"locations\":[\"aws:us-east-2\"],\"subtype\":\"http\",\"created_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":142439982,\"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-04-02T15:35:39.198Z",
61+
"time": 1262
62+
},
63+
{
64+
"_id": "c70757db460f03fae33e51e24a31a2a0",
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\":[\"sxp-kz5-mk7\"]}"
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\":\"sxp-kz5-mk7\",\"deleted_at\":\"2024-04-02T15:35:41.326918+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-04-02T15:35:40.475Z",
114+
"time": 863
115+
}
116+
],
117+
"pages": [],
118+
"version": "1.2"
119+
}
120+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/**
2+
* Create an API test with a file payload 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+
assertions: [
14+
{
15+
operator: "is",
16+
property: "{{ PROPERTY }}",
17+
target: "text/html",
18+
type: "header",
19+
},
20+
{
21+
operator: "lessThan",
22+
target: 2000,
23+
type: "responseTime",
24+
timingsScope: "withoutDNS",
25+
},
26+
{
27+
operator: "validatesJSONPath",
28+
target: {
29+
jsonPath: "topKey",
30+
operator: "isNot",
31+
targetValue: "0",
32+
},
33+
type: "body",
34+
},
35+
{
36+
operator: "validatesXPath",
37+
target: {
38+
xPath: "target-xpath",
39+
targetValue: "0",
40+
operator: "contains",
41+
},
42+
type: "body",
43+
},
44+
],
45+
configVariables: [
46+
{
47+
example: "content-type",
48+
name: "PROPERTY",
49+
pattern: "content-type",
50+
type: "text",
51+
},
52+
],
53+
request: {
54+
certificate: {
55+
cert: {
56+
content: "cert-content",
57+
filename: "cert-filename",
58+
updatedAt: "2020-10-16T09:23:24.857Z",
59+
},
60+
key: {
61+
content: "key-content",
62+
filename: "key-filename",
63+
updatedAt: "2020-10-16T09:23:24.857Z",
64+
},
65+
},
66+
headers: {
67+
unique: "examplesynthetic",
68+
},
69+
method: "GET",
70+
timeout: 10,
71+
url: "https://datadoghq.com",
72+
proxy: {
73+
url: "https://datadoghq.com",
74+
headers: {},
75+
},
76+
bodyType: "application/octet-stream",
77+
files: [
78+
{
79+
name: "file name",
80+
content: "file content",
81+
type: "file type",
82+
},
83+
],
84+
basicAuth: {
85+
accessTokenUrl: "https://datadog-token.com",
86+
audience: "audience",
87+
clientId: "client-id",
88+
clientSecret: "client-secret",
89+
resource: "resource",
90+
scope: "yoyo",
91+
tokenApiAuthentication: "header",
92+
type: "oauth-client",
93+
},
94+
persistCookies: true,
95+
},
96+
},
97+
locations: ["aws:us-east-2"],
98+
message: "BDD test payload: synthetics_api_http_test_payload.json",
99+
name: "Example-Synthetic",
100+
options: {
101+
acceptSelfSigned: false,
102+
allowInsecure: true,
103+
followRedirects: true,
104+
minFailureDuration: 10,
105+
minLocationFailed: 1,
106+
monitorName: "Example-Synthetic",
107+
monitorPriority: 5,
108+
retry: {
109+
count: 3,
110+
interval: 10,
111+
},
112+
tickEvery: 60,
113+
httpVersion: "http2",
114+
},
115+
subtype: "http",
116+
tags: ["testing:api"],
117+
type: "api",
118+
},
119+
};
120+
121+
apiInstance
122+
.createSyntheticsAPITest(params)
123+
.then((data: v1.SyntheticsAPITest) => {
124+
console.log(
125+
"API called successfully. Returned data: " + JSON.stringify(data)
126+
);
127+
})
128+
.catch((error: any) => console.error(error));

examples/v1/synthetics/UpdateBrowserTest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const params: v1.SyntheticsApiUpdateBrowserTestRequest = {
3131
key: {},
3232
},
3333
certificateDomains: [],
34+
files: [{}],
3435
httpVersion: "http1",
3536
proxy: {
3637
url: "https://example.com",

0 commit comments

Comments
 (0)