Skip to content

Commit 7b06ecc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add bodyType to Synthetics request (#901)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 24b6ebb commit 7b06ecc

File tree

8 files changed

+68
-9
lines changed

8 files changed

+68
-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.4",
7-
"regenerated": "2022-11-08 09:49:27.755753",
8-
"spec_repo_commit": "9146e44b"
7+
"regenerated": "2022-11-08 20:15:12.756844",
8+
"spec_repo_commit": "ce8fbc1a"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-11-08 09:49:27.768024",
13-
"spec_repo_commit": "9146e44b"
12+
"regenerated": "2022-11-08 20:15:12.771024",
13+
"spec_repo_commit": "ce8fbc1a"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13231,6 +13231,8 @@ components:
1323113231
body:
1323213232
description: Body to include in the test.
1323313233
type: string
13234+
bodyType:
13235+
$ref: '#/components/schemas/SyntheticsTestRequestBodyType'
1323413236
certificate:
1323513237
$ref: '#/components/schemas/SyntheticsTestRequestCertificate'
1323613238
certificateDomains:
@@ -13309,6 +13311,24 @@ components:
1330913311
example: https://example.com
1331013312
type: string
1331113313
type: object
13314+
SyntheticsTestRequestBodyType:
13315+
description: Type of the request body.
13316+
enum:
13317+
- text/plain
13318+
- application/json
13319+
- text/xml
13320+
- text/html
13321+
- application/x-www-form-urlencoded
13322+
- graphql
13323+
example: text/plain
13324+
type: string
13325+
x-enum-varnames:
13326+
- TEXT_PLAIN
13327+
- APPLICATION_JSON
13328+
- TEXT_XML
13329+
- TEXT_HTML
13330+
- APPLICATION_X_WWW_FORM_URLENCODED
13331+
- GRAPHQL
1331213332
SyntheticsTestRequestCertificate:
1331313333
description: Client certificate to use when performing the test request.
1331413334
properties:

examples/v1/synthetics/UpdateBrowserTest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const params: v1.SyntheticsApiUpdateBrowserTestRequest = {
2323
type: "web",
2424
username: "my_username",
2525
},
26+
bodyType: "text/plain",
2627
certificate: {
2728
cert: {},
2829
key: {},

features/v1/synthetics.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Feature: Synthetics
3434
@generated @skip @team:DataDog/synthetics-app
3535
Scenario: Create a browser test returns "- JSON format is wrong" response
3636
Given new "CreateSyntheticsBrowserTest" request
37-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
37+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
3838
When the request is sent
3939
Then the response status is 400 - JSON format is wrong
4040

@@ -59,7 +59,7 @@ Feature: Synthetics
5959
@generated @skip @team:DataDog/synthetics-app
6060
Scenario: Create a browser test returns "Test quota is reached" response
6161
Given new "CreateSyntheticsBrowserTest" request
62-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
62+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
6363
When the request is sent
6464
Then the response status is 402 Test quota is reached
6565

@@ -241,23 +241,23 @@ Feature: Synthetics
241241
Scenario: Edit a browser test returns "- JSON format is wrong" response
242242
Given new "UpdateBrowserTest" request
243243
And request contains "public_id" parameter from "REPLACE.ME"
244-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
244+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
245245
When the request is sent
246246
Then the response status is 400 - JSON format is wrong
247247

248248
@generated @skip @team:DataDog/synthetics-app
249249
Scenario: Edit a browser test returns "- Synthetic Monitoring is not activated for the user" response
250250
Given new "UpdateBrowserTest" request
251251
And request contains "public_id" parameter from "REPLACE.ME"
252-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
252+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
253253
When the request is sent
254254
Then the response status is 404 - Synthetic Monitoring is not activated for the user
255255

256256
@generated @skip @team:DataDog/synthetics-app
257257
Scenario: Edit a browser test returns "OK" response
258258
Given new "UpdateBrowserTest" request
259259
And request contains "public_id" parameter from "REPLACE.ME"
260-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
260+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
261261
When the request is sent
262262
Then the response status is 200 OK
263263

packages/datadog-api-client-v1/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ export { SyntheticsTestOptionsRetry } from "./models/SyntheticsTestOptionsRetry"
874874
export { SyntheticsTestPauseStatus } from "./models/SyntheticsTestPauseStatus";
875875
export { SyntheticsTestProcessStatus } from "./models/SyntheticsTestProcessStatus";
876876
export { SyntheticsTestRequest } from "./models/SyntheticsTestRequest";
877+
export { SyntheticsTestRequestBodyType } from "./models/SyntheticsTestRequestBodyType";
877878
export { SyntheticsTestRequestCertificate } from "./models/SyntheticsTestRequestCertificate";
878879
export { SyntheticsTestRequestCertificateItem } from "./models/SyntheticsTestRequestCertificateItem";
879880
export { SyntheticsTestRequestProxy } from "./models/SyntheticsTestRequestProxy";

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,14 @@ const enumsMap: { [key: string]: any[] } = {
11041104
"finished",
11051105
"finished_with_error",
11061106
],
1107+
SyntheticsTestRequestBodyType: [
1108+
"text/plain",
1109+
"application/json",
1110+
"text/xml",
1111+
"text/html",
1112+
"application/x-www-form-urlencoded",
1113+
"graphql",
1114+
],
11071115
SyntheticsWarningType: ["user_locator"],
11081116
TableWidgetCellDisplayMode: ["number", "bar"],
11091117
TableWidgetDefinitionType: ["query_table"],

packages/datadog-api-client-v1/models/SyntheticsTestRequest.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
import { HTTPMethod } from "./HTTPMethod";
77
import { SyntheticsBasicAuth } from "./SyntheticsBasicAuth";
8+
import { SyntheticsTestRequestBodyType } from "./SyntheticsTestRequestBodyType";
89
import { SyntheticsTestRequestCertificate } from "./SyntheticsTestRequestCertificate";
910
import { SyntheticsTestRequestProxy } from "./SyntheticsTestRequestProxy";
1011

@@ -26,6 +27,10 @@ export class SyntheticsTestRequest {
2627
* Body to include in the test.
2728
*/
2829
"body"?: string;
30+
/**
31+
* Type of the request body.
32+
*/
33+
"bodyType"?: SyntheticsTestRequestBodyType;
2934
/**
3035
* Client certificate to use when performing the test request.
3136
*/
@@ -130,6 +135,10 @@ export class SyntheticsTestRequest {
130135
baseName: "body",
131136
type: "string",
132137
},
138+
bodyType: {
139+
baseName: "bodyType",
140+
type: "SyntheticsTestRequestBodyType",
141+
},
133142
certificate: {
134143
baseName: "certificate",
135144
type: "SyntheticsTestRequestCertificate",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
export type SyntheticsTestRequestBodyType =
8+
| typeof TEXT_PLAIN
9+
| typeof APPLICATION_JSON
10+
| typeof TEXT_XML
11+
| typeof TEXT_HTML
12+
| typeof APPLICATION_X_WWW_FORM_URLENCODED
13+
| typeof GRAPHQL;
14+
export const TEXT_PLAIN = "text/plain";
15+
export const APPLICATION_JSON = "application/json";
16+
export const TEXT_XML = "text/xml";
17+
export const TEXT_HTML = "text/html";
18+
export const APPLICATION_X_WWW_FORM_URLENCODED =
19+
"application/x-www-form-urlencoded";
20+
export const GRAPHQL = "graphql";

0 commit comments

Comments
 (0)