From 8d4d5030f2586a0ccd20d7ba4c5cc5fd7b6a85ed Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 22 Jun 2022 15:25:13 +0000 Subject: [PATCH] Regenerate client from commit 55922470 of spec repo --- .apigentools-info | 8 ++-- .generator/schemas/v1/openapi.yaml | 8 ++++ .../frozen.json | 2 +- .../recording.har | 32 +++++++------- .../v1/synthetics/CreateSyntheticsAPITest.ts | 3 ++ .../CreateSyntheticsBrowserTest_2932742688.ts | 3 ++ examples/v1/synthetics/UpdateBrowserTest.ts | 3 ++ features/v1/synthetics.feature | 22 +++++----- ...rowser_test_payload_with_rum_settings.json | 5 ++- packages/datadog-api-client-v1/index.ts | 1 + .../models/ObjectSerializer.ts | 2 + .../models/SyntheticsTestCiOptions.ts | 42 +++++++++++++++++++ .../models/SyntheticsTestOptions.ts | 9 ++++ 13 files changed, 107 insertions(+), 33 deletions(-) create mode 100644 packages/datadog-api-client-v1/models/SyntheticsTestCiOptions.ts diff --git a/.apigentools-info b/.apigentools-info index 6df7a0dcd3d..4fcd92c3676 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.2", - "regenerated": "2022-06-20 06:54:41.109272", - "spec_repo_commit": "17f09b79" + "regenerated": "2022-06-22 15:23:51.453877", + "spec_repo_commit": "55922470" }, "v2": { "apigentools_version": "1.6.2", - "regenerated": "2022-06-20 06:54:41.128692", - "spec_repo_commit": "17f09b79" + "regenerated": "2022-06-22 15:23:51.468090", + "spec_repo_commit": "55922470" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 5ddb1e1840c..f48d3bca31e 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -12027,6 +12027,12 @@ components: - TYPE_TEXT - UPLOAD_FILES - WAIT + SyntheticsTestCiOptions: + description: CI/CD options for a Synthetic test. + properties: + executionRule: + $ref: '#/components/schemas/SyntheticsTestExecutionRule' + type: object SyntheticsTestConfig: description: Configuration object for a Synthetic test. properties: @@ -12192,6 +12198,8 @@ components: description: For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP. type: boolean + ci: + $ref: '#/components/schemas/SyntheticsTestCiOptions' device_ids: description: For browser test, array with the different device IDs used to run the test. diff --git a/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/frozen.json b/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/frozen.json index e66e6fd04c5..94901ba8015 100644 --- a/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/frozen.json +++ b/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/frozen.json @@ -1 +1 @@ -"2022-05-18T13:08:12.878Z" +"2022-06-17T07:42:57.557Z" diff --git a/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/recording.har b/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/recording.har index 816fafbebe3..d48d422b943 100644 --- a/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/recording.har +++ b/cassettes/v1/Synthetics_2658572017/Create-a-browser-test-returns-OK-Returns-saved-rumSettings-response_515614798/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "19ad0a979b5d2b9976ec73b74de0cf7c", + "_id": "6f57420de311eb600099523bfc0f2fd9", "_order": 0, "cache": {}, "request": { - "bodySize": 848, + "bodySize": 881, "cookies": [], "headers": [ { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 585, + "headersSize": 586, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"config\":{\"assertions\":[],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"method\":\"GET\",\"url\":\"https://datadoghq.com\"},\"setCookie\":\"name:test\"},\"locations\":[\"aws:us-east-2\"],\"message\":\"Test message\",\"name\":\"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1652879292\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"device_ids\":[\"tablet\"],\"disableCors\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"noScreenshot\":true,\"retry\":{\"count\":3,\"interval\":10},\"rumSettings\":{\"applicationId\":\"mockApplicationId\",\"clientTokenId\":123456,\"isEnabled\":true},\"tick_every\":300},\"steps\":[{\"allowFailure\":false,\"isCritical\":true,\"name\":\"Refresh page\",\"params\":{},\"type\":\"refresh\"}],\"tags\":[\"testing:browser\"],\"type\":\"browser\"}" + "text": "{\"config\":{\"assertions\":[],\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"request\":{\"method\":\"GET\",\"url\":\"https://datadoghq.com\"},\"setCookie\":\"name:test\"},\"locations\":[\"aws:us-east-2\"],\"message\":\"Test message\",\"name\":\"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1655451777\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"ci\":{\"executionRule\":\"skipped\"},\"device_ids\":[\"tablet\"],\"disableCors\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"noScreenshot\":true,\"retry\":{\"count\":3,\"interval\":10},\"rumSettings\":{\"applicationId\":\"mockApplicationId\",\"clientTokenId\":123456,\"isEnabled\":true},\"tick_every\":300},\"steps\":[{\"allowFailure\":false,\"isCritical\":true,\"name\":\"Refresh page\",\"params\":{},\"type\":\"refresh\"}],\"tags\":[\"testing:browser\"],\"type\":\"browser\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/synthetics/tests/browser" }, "response": { - "bodySize": 1045, + "bodySize": 1078, "content": { "mimeType": "application/json", - "size": 1045, - "text": "{\"status\":\"paused\",\"public_id\":\"wfe-m7p-h4b\",\"tags\":[\"testing:browser\"],\"org_id\":321813,\"locations\":[\"aws:us-east-2\"],\"message\":\"Test message\",\"deleted_at\":null,\"name\":\"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1652879292\",\"monitor_id\":71860323,\"type\":\"browser\",\"created_at\":\"2022-05-18T13:08:13.276145+00:00\",\"modified_at\":\"2022-05-18T13:08:13.276145+00:00\",\"steps\":[{\"name\":\"Refresh page\",\"allowFailure\":false,\"params\":{},\"isCritical\":true,\"type\":\"refresh\"}],\"config\":{\"setCookie\":\"name:test\",\"request\":{\"url\":\"https://datadoghq.com\",\"method\":\"GET\"},\"assertions\":[],\"configVariables\":[{\"pattern\":\"content-type\",\"type\":\"text\",\"example\":\"content-type\",\"name\":\"PROPERTY\"}]},\"options\":{\"accept_self_signed\":false,\"retry\":{\"count\":3,\"interval\":10},\"min_location_failed\":1,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"noScreenshot\":true,\"rumSettings\":{\"isEnabled\":true,\"applicationId\":\"mockApplicationId\",\"clientTokenId\":123456},\"disableCors\":true,\"device_ids\":[\"tablet\"],\"tick_every\":300}}" + "size": 1078, + "text": "{\"status\":\"paused\",\"public_id\":\"m3n-vmq-fd3\",\"tags\":[\"testing:browser\"],\"org_id\":321813,\"locations\":[\"aws:us-east-2\"],\"message\":\"Test message\",\"deleted_at\":null,\"name\":\"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1655451777\",\"monitor_id\":74294599,\"type\":\"browser\",\"created_at\":\"2022-06-17T07:42:58.262163+00:00\",\"modified_at\":\"2022-06-17T07:42:58.262163+00:00\",\"steps\":[{\"name\":\"Refresh page\",\"allowFailure\":false,\"params\":{},\"isCritical\":true,\"type\":\"refresh\"}],\"config\":{\"setCookie\":\"name:test\",\"request\":{\"url\":\"https://datadoghq.com\",\"method\":\"GET\"},\"assertions\":[],\"configVariables\":[{\"pattern\":\"content-type\",\"type\":\"text\",\"example\":\"content-type\",\"name\":\"PROPERTY\"}]},\"options\":{\"accept_self_signed\":false,\"retry\":{\"count\":3,\"interval\":10},\"min_location_failed\":1,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"ci\":{\"executionRule\":\"skipped\"},\"noScreenshot\":true,\"rumSettings\":{\"isEnabled\":true,\"applicationId\":\"mockApplicationId\",\"clientTokenId\":12345},\"disableCors\":true,\"device_ids\":[\"tablet\"],\"tick_every\":300}}" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 667, + "headersSize": 666, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-18T13:08:12.898Z", - "time": 426 + "startedDateTime": "2022-06-17T07:42:57.572Z", + "time": 724 }, { - "_id": "76fc582c80fc7ec5dbafdb295ed98df2", + "_id": "c5079f787dd367dcfd03fe67de8bc455", "_order": 0, "cache": {}, "request": { @@ -85,7 +85,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"public_ids\":[\"wfe-m7p-h4b\"]}" + "text": "{\"public_ids\":[\"m3n-vmq-fd3\"]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/synthetics/tests/delete" @@ -95,7 +95,7 @@ "content": { "mimeType": "application/json", "size": 95, - "text": "{\"deleted_tests\":[{\"deleted_at\":\"2022-05-18T13:08:18.431221+00:00\",\"public_id\":\"wfe-m7p-h4b\"}]}" + "text": "{\"deleted_tests\":[{\"deleted_at\":\"2022-06-17T07:43:03.760052+00:00\",\"public_id\":\"m3n-vmq-fd3\"}]}" }, "cookies": [], "headers": [ @@ -104,14 +104,14 @@ "value": "application/json" } ], - "headersSize": 665, + "headersSize": 664, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-18T13:08:13.336Z", - "time": 5178 + "startedDateTime": "2022-06-17T07:42:58.308Z", + "time": 5625 } ], "pages": [], diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest.ts b/examples/v1/synthetics/CreateSyntheticsAPITest.ts index 4a0c66b98e6..4bac028ae3a 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest.ts +++ b/examples/v1/synthetics/CreateSyntheticsAPITest.ts @@ -26,6 +26,9 @@ const params: v1.SyntheticsApiCreateSyntheticsAPITestRequest = { message: "Notification message", name: "Example test name", options: { + ci: { + executionRule: "blocking", + }, deviceIds: ["laptop_large"], monitorOptions: {}, restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], diff --git a/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.ts b/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.ts index 006ae621796..ebd390cf565 100644 --- a/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.ts +++ b/examples/v1/synthetics/CreateSyntheticsBrowserTest_2932742688.ts @@ -47,6 +47,9 @@ const params: v1.SyntheticsApiCreateSyntheticsBrowserTestRequest = { clientTokenId: 123456, }, tickEvery: 300, + ci: { + executionRule: "skipped", + }, }, tags: ["testing:browser"], type: "browser", diff --git a/examples/v1/synthetics/UpdateBrowserTest.ts b/examples/v1/synthetics/UpdateBrowserTest.ts index 4b56d53d20f..e48b6b811ef 100644 --- a/examples/v1/synthetics/UpdateBrowserTest.ts +++ b/examples/v1/synthetics/UpdateBrowserTest.ts @@ -44,6 +44,9 @@ const params: v1.SyntheticsApiUpdateBrowserTestRequest = { message: "", name: "Example test name", options: { + ci: { + executionRule: "blocking", + }, deviceIds: ["laptop_large"], monitorOptions: {}, restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index 1afbc2a1e23..21a628af698 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -34,7 +34,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-app Scenario: Create a browser test returns "- JSON format is wrong" response Given new "CreateSyntheticsBrowserTest" request - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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": {"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"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -46,7 +46,7 @@ Feature: Synthetics Then the response status is 200 OK - Returns the created test details. And the response "options.rumSettings.isEnabled" is equal to true And the response "options.rumSettings.applicationId" is equal to "mockApplicationId" - And the response "options.rumSettings.clientTokenId" is equal to 123456 + And the response "options.rumSettings.clientTokenId" is equal to 12345 @team:DataDog/synthetics-app Scenario: Create a browser test returns "OK - Returns the created test details." response @@ -59,7 +59,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-app Scenario: Create a browser test returns "Test quota is reached" response Given new "CreateSyntheticsBrowserTest" request - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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": {"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"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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"} When the request is sent Then the response status is 402 Test quota is reached @@ -126,21 +126,21 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-app Scenario: Create an API test returns "- JSON format is wrong" response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"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", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification 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", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 400 - JSON format is wrong @generated @skip @team:DataDog/synthetics-app Scenario: Create an API test returns "OK - Returns the created test details." response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"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", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification 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", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 200 OK - Returns the created test details. @generated @skip @team:DataDog/synthetics-app Scenario: Create an API test returns "Test quota is reached" response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"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", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification 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", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 402 Test quota is reached @@ -232,7 +232,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "- JSON format is wrong" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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": {"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"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -240,7 +240,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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": {"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"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user @@ -248,7 +248,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "OK" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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": {"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"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "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"} When the request is sent Then the response status is 200 OK @@ -288,7 +288,7 @@ Feature: Synthetics Scenario: Edit an API test returns "- JSON format is wrong" response Given new "UpdateAPITest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"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", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification 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", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -296,7 +296,7 @@ Feature: Synthetics Scenario: Edit an API test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateAPITest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"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", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification 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", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user diff --git a/features/v1/synthetics_browser_test_payload_with_rum_settings.json b/features/v1/synthetics_browser_test_payload_with_rum_settings.json index a2ea2b58931..1243934ec20 100644 --- a/features/v1/synthetics_browser_test_payload_with_rum_settings.json +++ b/features/v1/synthetics_browser_test_payload_with_rum_settings.json @@ -30,7 +30,10 @@ "applicationId": "mockApplicationId", "clientTokenId": 123456 }, - "tick_every": 300 + "tick_every": 300, + "ci": { + "executionRule": "skipped" + } }, "tags": ["testing:browser"], "type": "browser", diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 356fe39ef9c..b9b5724eb97 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -828,6 +828,7 @@ export { SyntheticsStep } from "./models/SyntheticsStep"; export { SyntheticsStepDetail } from "./models/SyntheticsStepDetail"; export { SyntheticsStepDetailWarning } from "./models/SyntheticsStepDetailWarning"; export { SyntheticsStepType } from "./models/SyntheticsStepType"; +export { SyntheticsTestCiOptions } from "./models/SyntheticsTestCiOptions"; export { SyntheticsTestConfig } from "./models/SyntheticsTestConfig"; export { SyntheticsTestDetails } from "./models/SyntheticsTestDetails"; export { SyntheticsTestDetailsSubType } from "./models/SyntheticsTestDetailsSubType"; diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 7701f797184..f2846febca8 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -378,6 +378,7 @@ import { SyntheticsSSLCertificateSubject } from "./SyntheticsSSLCertificateSubje import { SyntheticsStep } from "./SyntheticsStep"; import { SyntheticsStepDetail } from "./SyntheticsStepDetail"; import { SyntheticsStepDetailWarning } from "./SyntheticsStepDetailWarning"; +import { SyntheticsTestCiOptions } from "./SyntheticsTestCiOptions"; import { SyntheticsTestConfig } from "./SyntheticsTestConfig"; import { SyntheticsTestDetails } from "./SyntheticsTestDetails"; import { SyntheticsTestOptions } from "./SyntheticsTestOptions"; @@ -1608,6 +1609,7 @@ const typeMap: { [index: string]: any } = { SyntheticsStep: SyntheticsStep, SyntheticsStepDetail: SyntheticsStepDetail, SyntheticsStepDetailWarning: SyntheticsStepDetailWarning, + SyntheticsTestCiOptions: SyntheticsTestCiOptions, SyntheticsTestConfig: SyntheticsTestConfig, SyntheticsTestDetails: SyntheticsTestDetails, SyntheticsTestOptions: SyntheticsTestOptions, diff --git a/packages/datadog-api-client-v1/models/SyntheticsTestCiOptions.ts b/packages/datadog-api-client-v1/models/SyntheticsTestCiOptions.ts new file mode 100644 index 00000000000..8c12d4b4dcf --- /dev/null +++ b/packages/datadog-api-client-v1/models/SyntheticsTestCiOptions.ts @@ -0,0 +1,42 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsTestExecutionRule } from "./SyntheticsTestExecutionRule"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * CI/CD options for a Synthetic test. + */ +export class SyntheticsTestCiOptions { + /** + * Execution rule for a Synthetics test. + */ + "executionRule"?: SyntheticsTestExecutionRule; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + executionRule: { + baseName: "executionRule", + type: "SyntheticsTestExecutionRule", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestCiOptions.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SyntheticsTestOptions.ts b/packages/datadog-api-client-v1/models/SyntheticsTestOptions.ts index 71b8c886a43..b56d891bf04 100644 --- a/packages/datadog-api-client-v1/models/SyntheticsTestOptions.ts +++ b/packages/datadog-api-client-v1/models/SyntheticsTestOptions.ts @@ -5,6 +5,7 @@ */ import { SyntheticsBrowserTestRumSettings } from "./SyntheticsBrowserTestRumSettings"; import { SyntheticsDeviceID } from "./SyntheticsDeviceID"; +import { SyntheticsTestCiOptions } from "./SyntheticsTestCiOptions"; import { SyntheticsTestOptionsMonitorOptions } from "./SyntheticsTestOptionsMonitorOptions"; import { SyntheticsTestOptionsRetry } from "./SyntheticsTestOptionsRetry"; @@ -27,6 +28,10 @@ export class SyntheticsTestOptions { * For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP. */ "checkCertificateRevocation"?: boolean; + /** + * CI/CD options for a Synthetic test. + */ + "ci"?: SyntheticsTestCiOptions; /** * For browser test, array with the different device IDs used to run the test. */ @@ -113,6 +118,10 @@ export class SyntheticsTestOptions { baseName: "checkCertificateRevocation", type: "boolean", }, + ci: { + baseName: "ci", + type: "SyntheticsTestCiOptions", + }, deviceIds: { baseName: "device_ids", type: "Array",