From 2896403213ee3b698b99e2060480a33ac3f747d9 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 23 Feb 2022 10:10:37 +0000 Subject: [PATCH] Regenerate client from commit cf974e8 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 6 +- .../Get-a-synthetics-monitor-s-details.frozen | 2 +- .../Get-a-synthetics-monitor-s-details.yml | 28 +++--- ...s-the-created-test-details-response.frozen | 1 + ...urns-the-created-test-details-response.yml | 39 ++++++++ ...s-the-created-test-details-response.frozen | 1 + ...urns-the-created-test-details-response.yml | 38 ++++++++ ...dit-an-API-test-returns-OK-response.frozen | 2 +- .../Edit-an-API-test-returns-OK-response.yml | 30 +++---- ...ynthetics-tests-returns-OK-response.frozen | 2 +- ...r-Synthetics-tests-returns-OK-response.yml | 24 ++--- .../CreateSyntheticsAPITest_1072503741.rb | 36 ++++++++ .../CreateSyntheticsAPITest_1487281163.rb | 88 +++++++++++++++++++ features/v1/given.json | 2 +- features/v1/synthetics.feature | 39 +++++--- .../v1/synthetics_api_http_test_payload.json | 69 +++++++++++++++ .../v1/synthetics_api_ssl_test_payload.json | 26 ++++++ .../v1/models/synthetics_test_options.rb | 12 ++- 19 files changed, 390 insertions(+), 63 deletions(-) create mode 100644 cassettes/features/v1/synthetics/Create-an-API-HTTP-test-returns-OK-Returns-the-created-test-details-response.frozen create mode 100644 cassettes/features/v1/synthetics/Create-an-API-HTTP-test-returns-OK-Returns-the-created-test-details-response.yml create mode 100644 cassettes/features/v1/synthetics/Create-an-API-SSL-test-returns-OK-Returns-the-created-test-details-response.frozen create mode 100644 cassettes/features/v1/synthetics/Create-an-API-SSL-test-returns-OK-Returns-the-created-test-details-response.yml create mode 100644 examples/v1/synthetics/CreateSyntheticsAPITest_1072503741.rb create mode 100644 examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb create mode 100644 features/v1/synthetics_api_http_test_payload.json create mode 100644 features/v1/synthetics_api_ssl_test_payload.json diff --git a/.apigentools-info b/.apigentools-info index d25460deab5e..a30d66d212d1 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.2", - "regenerated": "2022-02-23 09:52:53.536504", - "spec_repo_commit": "c049b6d" + "regenerated": "2022-02-23 10:09:46.218460", + "spec_repo_commit": "cf974e8" }, "v2": { "apigentools_version": "1.6.2", - "regenerated": "2022-02-23 09:52:53.558688", - "spec_repo_commit": "c049b6d" + "regenerated": "2022-02-23 10:09:46.237606", + "spec_repo_commit": "cf974e8" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 63b03cac25f9..44d2c9407ac4 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -11874,6 +11874,10 @@ components: allow_insecure: description: Allows loading insecure content for an HTTP request. type: boolean + checkCertificateRevocation: + description: For SSL test, whether or not the test should fail on revoked + certificate in stapled OCSP. + type: boolean device_ids: description: For browser test, array with the different device IDs used to run the test. @@ -24083,7 +24087,7 @@ paths: x-given: synthetics_api_test: parameters: - - file: synthetics_api_test_payload.json + - file: synthetics_api_http_test_payload.json name: body step: there is a valid "synthetics_api_test" in the system synthetics_api_test_with_wrong_dns: diff --git a/cassettes/features/v1/monitors/Get-a-synthetics-monitor-s-details.frozen b/cassettes/features/v1/monitors/Get-a-synthetics-monitor-s-details.frozen index 56066e879032..5f42f4bcc257 100644 --- a/cassettes/features/v1/monitors/Get-a-synthetics-monitor-s-details.frozen +++ b/cassettes/features/v1/monitors/Get-a-synthetics-monitor-s-details.frozen @@ -1 +1 @@ -2022-01-11T18:26:16.498Z \ No newline at end of file +2022-02-22T17:12:27.896Z \ No newline at end of file diff --git a/cassettes/features/v1/monitors/Get-a-synthetics-monitor-s-details.yml b/cassettes/features/v1/monitors/Get-a-synthetics-monitor-s-details.yml index c220b0ed82e1..e78f4cb47547 100644 --- a/cassettes/features/v1/monitors/Get-a-synthetics-monitor-s-details.yml +++ b/cassettes/features/v1/monitors/Get-a-synthetics-monitor-s-details.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Tue, 11 Jan 2022 18:26:16 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:27 GMT request: body: encoding: UTF-8 - string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testgetasyntheticsmonitorsdetails1641925576"},"method":"GET","proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","name":"Test-Get_a_synthetics_monitor_s_details-1641925576","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1641925576","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testgetasyntheticsmonitorsdetails1645549947"},"method":"GET","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-Get_a_synthetics_monitor_s_details-1645549947","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1645549947","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: Content-Type: - application/json @@ -13,34 +13,34 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"status":"live","public_id":"6sz-zdc-kxw","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","deleted_at":null,"name":"Test-Get_a_synthetics_monitor_s_details-1641925576","monitor_id":60619271,"type":"api","created_at":"2022-01-11T18:26:17.180619+00:00","modified_at":"2022-01-11T18:26:17.180619+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testgetasyntheticsmonitorsdetails1641925576"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{ - PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"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,"monitor_priority":5,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1641925576","tick_every":60}}' + string: '{"status":"live","public_id":"87q-fuj-j2g","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_http_test_payload.json","deleted_at":null,"name":"Test-Get_a_synthetics_monitor_s_details-1645549947","monitor_id":64654478,"type":"api","created_at":"2022-02-22T17:12:28.762647+00:00","modified_at":"2022-02-22T17:12:28.762647+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testgetasyntheticsmonitorsdetails1645549947"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{ + PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"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,"monitor_priority":5,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1645549947","tick_every":60}}' status: code: 200 message: OK -- recorded_at: Tue, 11 Jan 2022 18:26:16 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:27 GMT request: body: null headers: Content-Type: - application/json method: GET - uri: https://api.datadoghq.com/api/v1/monitor/60619271 + uri: https://api.datadoghq.com/api/v1/monitor/64654478 response: body: encoding: UTF-8 - string: '{"restricted_roles":null,"tags":["testing:api","probe_dc:aws:us-east-2","check_type:api","check_status:live"],"deleted":null,"query":"no_query","message":"BDD - test payload: synthetics_api_test_payload.json","id":60619271,"multi":false,"name":"Test-Get_a_synthetics_monitor_s_details-1641925576","created":"2022-01-11T18:26:17.145876+00:00","created_at":1641925577000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2022-01-11T18:26:17.145876+00:00","priority":5,"overall_state_modified":null,"overall_state":"No - Data","type":"synthetics alert","options":{"notify_audit":false,"locked":false,"silenced":{},"include_tags":true,"new_host_delay":300,"notify_no_data":false,"synthetics_check_id":"6sz-zdc-kxw"}}' + string: '{"restricted_roles":null,"tags":["testing:api","probe_dc:aws:us-east-2","check_type:api","check_status:live","ci_execution_rule:blocking"],"deleted":null,"query":"no_query","message":"BDD + test payload: synthetics_api_http_test_payload.json","id":64654478,"multi":false,"name":"Test-Get_a_synthetics_monitor_s_details-1645549947","created":"2022-02-22T17:12:28.732932+00:00","created_at":1645549948000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2022-02-22T17:12:28.732932+00:00","priority":5,"overall_state_modified":null,"overall_state":"No + Data","type":"synthetics alert","options":{"notify_audit":false,"locked":false,"silenced":{},"include_tags":true,"new_host_delay":300,"notify_no_data":false,"synthetics_check_id":"87q-fuj-j2g"}}' status: code: 200 message: OK -- recorded_at: Tue, 11 Jan 2022 18:26:16 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:27 GMT request: body: encoding: UTF-8 - string: '{"public_ids":["6sz-zdc-kxw"]}' + string: '{"public_ids":["87q-fuj-j2g"]}' headers: Content-Type: - application/json @@ -49,7 +49,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"deleted_tests":[{"deleted_at":"2022-01-11T18:26:29.979222+00:00","public_id":"6sz-zdc-kxw"}]}' + string: '{"deleted_tests":[{"deleted_at":"2022-02-22T17:12:29.793575+00:00","public_id":"87q-fuj-j2g"}]}' status: code: 200 message: OK diff --git a/cassettes/features/v1/synthetics/Create-an-API-HTTP-test-returns-OK-Returns-the-created-test-details-response.frozen b/cassettes/features/v1/synthetics/Create-an-API-HTTP-test-returns-OK-Returns-the-created-test-details-response.frozen new file mode 100644 index 000000000000..adfe09efd8d6 --- /dev/null +++ b/cassettes/features/v1/synthetics/Create-an-API-HTTP-test-returns-OK-Returns-the-created-test-details-response.frozen @@ -0,0 +1 @@ +2022-02-22T17:12:29.866Z \ No newline at end of file diff --git a/cassettes/features/v1/synthetics/Create-an-API-HTTP-test-returns-OK-Returns-the-created-test-details-response.yml b/cassettes/features/v1/synthetics/Create-an-API-HTTP-test-returns-OK-Returns-the-created-test-details-response.yml new file mode 100644 index 000000000000..0e510ae19166 --- /dev/null +++ b/cassettes/features/v1/synthetics/Create-an-API-HTTP-test-returns-OK-Returns-the-created-test-details-response.yml @@ -0,0 +1,39 @@ +http_interactions: +- recorded_at: Tue, 22 Feb 2022 17:12:29 GMT + request: + body: + encoding: UTF-8 + string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1645549949"},"method":"GET","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_HTTP_test_returns_OK_Returns_the_created_test_details_response-1645549949","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1645549949","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + headers: + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/api + response: + body: + encoding: UTF-8 + string: '{"status":"live","public_id":"8ju-8gb-uzk","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_http_test_payload.json","deleted_at":null,"name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1645549949","monitor_id":64654479,"type":"api","created_at":"2022-02-22T17:12:30.659455+00:00","modified_at":"2022-02-22T17:12:30.659455+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1645549949"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{ + PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"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,"monitor_priority":5,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1645549949","tick_every":60}}' + status: + code: 200 + message: OK +- recorded_at: Tue, 22 Feb 2022 17:12:29 GMT + request: + body: + encoding: UTF-8 + string: '{"public_ids":["8ju-8gb-uzk"]}' + headers: + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete + response: + body: + encoding: UTF-8 + string: '{"deleted_tests":[{"deleted_at":"2022-02-22T17:12:31.194196+00:00","public_id":"8ju-8gb-uzk"}]}' + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v1/synthetics/Create-an-API-SSL-test-returns-OK-Returns-the-created-test-details-response.frozen b/cassettes/features/v1/synthetics/Create-an-API-SSL-test-returns-OK-Returns-the-created-test-details-response.frozen new file mode 100644 index 000000000000..15ecafd90260 --- /dev/null +++ b/cassettes/features/v1/synthetics/Create-an-API-SSL-test-returns-OK-Returns-the-created-test-details-response.frozen @@ -0,0 +1 @@ +2022-02-22T17:20:11.629Z \ No newline at end of file diff --git a/cassettes/features/v1/synthetics/Create-an-API-SSL-test-returns-OK-Returns-the-created-test-details-response.yml b/cassettes/features/v1/synthetics/Create-an-API-SSL-test-returns-OK-Returns-the-created-test-details-response.yml new file mode 100644 index 000000000000..d420cbaeb027 --- /dev/null +++ b/cassettes/features/v1/synthetics/Create-an-API-SSL-test-returns-OK-Returns-the-created-test-details-response.yml @@ -0,0 +1,38 @@ +http_interactions: +- recorded_at: Tue, 22 Feb 2022 17:20:11 GMT + request: + body: + encoding: UTF-8 + string: '{"config":{"assertions":[{"operator":"isInMoreThan","target":10,"type":"certificate"}],"request":{"host":"datadoghq.com","port":443}},"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_ssl_test_payload.json","name":"Test-Create_an_API_SSL_test_returns_OK_Returns_the_created_test_details_response-1645550411","options":{"accept_self_signed":true,"checkCertificateRevocation":true,"tick_every":60},"subtype":"ssl","tags":["testing:api"],"type":"api"}' + headers: + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/api + response: + body: + encoding: UTF-8 + string: '{"status":"live","public_id":"t4n-wba-ghj","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_ssl_test_payload.json","deleted_at":null,"name":"Test-Create_an_API_SSL_test_returns_OK_Returns_the_created_test_details_response-1645550411","monitor_id":64655318,"type":"api","created_at":"2022-02-22T17:20:12.060843+00:00","modified_at":"2022-02-22T17:20:12.060843+00:00","subtype":"ssl","config":{"request":{"host":"datadoghq.com","port":443},"assertions":[{"operator":"isInMoreThan","type":"certificate","target":10}]},"options":{"accept_self_signed":true,"checkCertificateRevocation":true,"tick_every":60}}' + status: + code: 200 + message: OK +- recorded_at: Tue, 22 Feb 2022 17:20:11 GMT + request: + body: + encoding: UTF-8 + string: '{"public_ids":["t4n-wba-ghj"]}' + headers: + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete + response: + body: + encoding: UTF-8 + string: '{"deleted_tests":[{"deleted_at":"2022-02-22T17:20:12.356340+00:00","public_id":"t4n-wba-ghj"}]}' + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v1/synthetics/Edit-an-API-test-returns-OK-response.frozen b/cassettes/features/v1/synthetics/Edit-an-API-test-returns-OK-response.frozen index c8b194bb06a2..33f86f70d064 100644 --- a/cassettes/features/v1/synthetics/Edit-an-API-test-returns-OK-response.frozen +++ b/cassettes/features/v1/synthetics/Edit-an-API-test-returns-OK-response.frozen @@ -1 +1 @@ -2022-02-10T12:24:16.771Z \ No newline at end of file +2022-02-22T17:12:31.674Z \ No newline at end of file diff --git a/cassettes/features/v1/synthetics/Edit-an-API-test-returns-OK-response.yml b/cassettes/features/v1/synthetics/Edit-an-API-test-returns-OK-response.yml index 32177c6ce041..1ce8efa18595 100644 --- a/cassettes/features/v1/synthetics/Edit-an-API-test-returns-OK-response.yml +++ b/cassettes/features/v1/synthetics/Edit-an-API-test-returns-OK-response.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Thu, 10 Feb 2022 12:24:16 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:31 GMT request: body: encoding: UTF-8 - string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testeditanapitestreturnsokresponse1644495856"},"method":"GET","proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1644495856","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1644495856","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testeditanapitestreturnsokresponse1645549951"},"method":"GET","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-Edit_an_API_test_returns_OK_response-1645549951","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1645549951","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: Content-Type: - application/json @@ -13,37 +13,37 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"status":"live","public_id":"xdu-3kb-n4b","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","deleted_at":null,"name":"Test-Edit_an_API_test_returns_OK_response-1644495856","monitor_id":63812391,"type":"api","created_at":"2022-02-10T12:24:17.500936+00:00","modified_at":"2022-02-10T12:24:17.500936+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testeditanapitestreturnsokresponse1644495856"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{ - PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"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,"monitor_priority":5,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1644495856","tick_every":60}}' + string: '{"status":"live","public_id":"y28-82w-h8h","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_http_test_payload.json","deleted_at":null,"name":"Test-Edit_an_API_test_returns_OK_response-1645549951","monitor_id":64654480,"type":"api","created_at":"2022-02-22T17:12:32.292615+00:00","modified_at":"2022-02-22T17:12:32.292615+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testeditanapitestreturnsokresponse1645549951"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{ + PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"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,"monitor_priority":5,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1645549951","tick_every":60}}' status: code: 200 message: OK -- recorded_at: Thu, 10 Feb 2022 12:24:16 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:31 GMT request: body: encoding: UTF-8 - string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testeditanapitestreturnsokresponse1644495856"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1644495856-updated","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-TestSyntheticsAPITestLifecycle-1623076664","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"status":"live","subtype":"http","tags":["testing:api"],"type":"api"}' + string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testeditanapitestreturnsokresponse1645549951"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1645549951-updated","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-TestSyntheticsAPITestLifecycle-1623076664","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"status":"live","subtype":"http","tags":["testing:api"],"type":"api"}' headers: Content-Type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v1/synthetics/tests/api/xdu-3kb-n4b + uri: https://api.datadoghq.com/api/v1/synthetics/tests/api/y28-82w-h8h response: body: encoding: UTF-8 - string: '{"status":"live","public_id":"xdu-3kb-n4b","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","deleted_at":null,"name":"Test-Edit_an_API_test_returns_OK_response-1644495856-updated","monitor_id":63812391,"type":"api","created_at":"2022-02-10T12:24:17.500936+00:00","modified_at":"2022-02-10T12:24:18.095318+00:00","subtype":"http","config":{"request":{"url":"https://datadoghq.com","headers":{"unique":"testeditanapitestreturnsokresponse1644495856"},"certificate":{"cert":{"updatedAt":"2020-10-16T09:23:24.857Z","filename":"cert-filename"},"key":{"updatedAt":"2020-10-16T09:23:24.857Z","filename":"key-filename"}},"method":"GET","timeout":10},"assertions":[{"operator":"is","property":"{{ + string: '{"status":"live","public_id":"y28-82w-h8h","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_test_payload.json","deleted_at":null,"name":"Test-Edit_an_API_test_returns_OK_response-1645549951-updated","monitor_id":64654480,"type":"api","created_at":"2022-02-22T17:12:32.292615+00:00","modified_at":"2022-02-22T17:12:32.924452+00:00","subtype":"http","config":{"request":{"url":"https://datadoghq.com","headers":{"unique":"testeditanapitestreturnsokresponse1645549951"},"certificate":{"cert":{"updatedAt":"2020-10-16T09:23:24.857Z","filename":"cert-filename"},"key":{"updatedAt":"2020-10-16T09:23:24.857Z","filename":"key-filename"}},"method":"GET","timeout":10},"assertions":[{"operator":"is","property":"{{ PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"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,"monitor_priority":5,"monitor_name":"Test-TestSyntheticsAPITestLifecycle-1623076664","tick_every":60}}' status: code: 200 message: OK -- recorded_at: Thu, 10 Feb 2022 12:24:16 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:31 GMT request: body: encoding: UTF-8 - string: '{"public_ids":["xdu-3kb-n4b"]}' + string: '{"public_ids":["y28-82w-h8h"]}' headers: Content-Type: - application/json @@ -52,7 +52,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"deleted_tests":[{"deleted_at":"2022-02-10T12:24:18.667573+00:00","public_id":"xdu-3kb-n4b"}]}' + string: '{"deleted_tests":[{"deleted_at":"2022-02-22T17:12:33.680393+00:00","public_id":"y28-82w-h8h"}]}' status: code: 200 message: OK diff --git a/cassettes/features/v1/synthetics/Trigger-Synthetics-tests-returns-OK-response.frozen b/cassettes/features/v1/synthetics/Trigger-Synthetics-tests-returns-OK-response.frozen index edd5e40429ea..3fdd16988056 100644 --- a/cassettes/features/v1/synthetics/Trigger-Synthetics-tests-returns-OK-response.frozen +++ b/cassettes/features/v1/synthetics/Trigger-Synthetics-tests-returns-OK-response.frozen @@ -1 +1 @@ -2022-02-10T12:24:21.021Z \ No newline at end of file +2022-02-22T17:12:33.664Z \ No newline at end of file diff --git a/cassettes/features/v1/synthetics/Trigger-Synthetics-tests-returns-OK-response.yml b/cassettes/features/v1/synthetics/Trigger-Synthetics-tests-returns-OK-response.yml index b06ec04171aa..47ee9bbca981 100644 --- a/cassettes/features/v1/synthetics/Trigger-Synthetics-tests-returns-OK-response.yml +++ b/cassettes/features/v1/synthetics/Trigger-Synthetics-tests-returns-OK-response.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Thu, 10 Feb 2022 12:24:21 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:33 GMT request: body: encoding: UTF-8 - string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testtriggersyntheticstestsreturnsokresponse1644495861"},"method":"GET","proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","name":"Test-Trigger_Synthetics_tests_returns_OK_response-1644495861","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetics_tests_returns_OK_response-1644495861","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"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":"testtriggersyntheticstestsreturnsokresponse1645549953"},"method":"GET","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-Trigger_Synthetics_tests_returns_OK_response-1645549953","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetics_tests_returns_OK_response-1645549953","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: Content-Type: - application/json @@ -13,17 +13,17 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"status":"live","public_id":"skb-dgn-9we","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD - test payload: synthetics_api_test_payload.json","deleted_at":null,"name":"Test-Trigger_Synthetics_tests_returns_OK_response-1644495861","monitor_id":63812394,"type":"api","created_at":"2022-02-10T12:24:21.760470+00:00","modified_at":"2022-02-10T12:24:21.760470+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testtriggersyntheticstestsreturnsokresponse1644495861"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{ - PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"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,"monitor_priority":5,"monitor_name":"Test-Trigger_Synthetics_tests_returns_OK_response-1644495861","tick_every":60}}' + string: '{"status":"live","public_id":"4fn-sy5-enu","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_http_test_payload.json","deleted_at":null,"name":"Test-Trigger_Synthetics_tests_returns_OK_response-1645549953","monitor_id":64654481,"type":"api","created_at":"2022-02-22T17:12:34.372050+00:00","modified_at":"2022-02-22T17:12:34.372050+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testtriggersyntheticstestsreturnsokresponse1645549953"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{ + PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"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,"monitor_priority":5,"monitor_name":"Test-Trigger_Synthetics_tests_returns_OK_response-1645549953","tick_every":60}}' status: code: 200 message: OK -- recorded_at: Thu, 10 Feb 2022 12:24:21 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:33 GMT request: body: encoding: UTF-8 - string: '{"tests":[{"public_id":"skb-dgn-9we"}]}' + string: '{"tests":[{"public_id":"4fn-sy5-enu"}]}' headers: Content-Type: - application/json @@ -32,16 +32,16 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"batch_id":null,"results":[{"result_id":"6901770802313039870","public_id":"skb-dgn-9we","location":30005}],"triggered_check_ids":["skb-dgn-9we"],"locations":[{"display_name":"Ohio + string: '{"batch_id":null,"results":[{"result_id":"630089876876805805","public_id":"4fn-sy5-enu","location":30005}],"triggered_check_ids":["4fn-sy5-enu"],"locations":[{"display_name":"Ohio (AWS)","name":"aws:us-east-2","region":"Americas","is_active":true,"is_public":true,"id":30005}]}' status: code: 200 message: OK -- recorded_at: Thu, 10 Feb 2022 12:24:21 GMT +- recorded_at: Tue, 22 Feb 2022 17:12:33 GMT request: body: encoding: UTF-8 - string: '{"public_ids":["skb-dgn-9we"]}' + string: '{"public_ids":["4fn-sy5-enu"]}' headers: Content-Type: - application/json @@ -50,7 +50,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"deleted_tests":[{"deleted_at":"2022-02-10T12:24:22.776073+00:00","public_id":"skb-dgn-9we"}]}' + string: '{"deleted_tests":[{"deleted_at":"2022-02-22T17:12:40.289621+00:00","public_id":"4fn-sy5-enu"}]}' status: code: 200 message: OK diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1072503741.rb b/examples/v1/synthetics/CreateSyntheticsAPITest_1072503741.rb new file mode 100644 index 000000000000..d934d28e3c62 --- /dev/null +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1072503741.rb @@ -0,0 +1,36 @@ +# Create an API SSL test returns "OK - Returns the created test details." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::SyntheticsAPI.new + +body = DatadogAPIClient::V1::SyntheticsAPITest.new({ + config: DatadogAPIClient::V1::SyntheticsAPITestConfig.new({ + assertions: [ + DatadogAPIClient::V1::SyntheticsAssertionTarget.new({ + operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS_IN_MORE_DAYS_THAN, + target: 10, + type: DatadogAPIClient::V1::SyntheticsAssertionType::CERTIFICATE, + }), + ], + request: DatadogAPIClient::V1::SyntheticsTestRequest.new({ + host: "datadoghq.com", + port: 443, + }), + }), + locations: [ + "aws:us-east-2", + ], + message: "BDD test payload: synthetics_api_ssl_test_payload.json", + name: "Example-Create_an_API_SSL_test_returns_OK_Returns_the_created_test_details_response", + options: DatadogAPIClient::V1::SyntheticsTestOptions.new({ + accept_self_signed: true, + check_certificate_revocation: true, + tick_every: 60, + }), + subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::SSL, + tags: [ + "testing:api", + ], + type: DatadogAPIClient::V1::SyntheticsAPITestType::API, +}) +p api_instance.create_synthetics_api_test(body) diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb b/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb new file mode 100644 index 000000000000..e444b7f4448d --- /dev/null +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.rb @@ -0,0 +1,88 @@ +# Create an API HTTP test returns "OK - Returns the created test details." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::SyntheticsAPI.new + +body = DatadogAPIClient::V1::SyntheticsAPITest.new({ + config: DatadogAPIClient::V1::SyntheticsAPITestConfig.new({ + assertions: [ + DatadogAPIClient::V1::SyntheticsAssertionTarget.new({ + operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS, + property: "{{ PROPERTY }}", + target: "text/html", + type: DatadogAPIClient::V1::SyntheticsAssertionType::HEADER, + }), + DatadogAPIClient::V1::SyntheticsAssertionTarget.new({ + operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::LESS_THAN, + target: 2000, + type: DatadogAPIClient::V1::SyntheticsAssertionType::RESPONSE_TIME, + }), + DatadogAPIClient::V1::SyntheticsAssertionJSONPathTarget.new({ + operator: DatadogAPIClient::V1::SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH, + target: DatadogAPIClient::V1::SyntheticsAssertionJSONPathTargetTarget.new({ + json_path: "topKey", + operator: "isNot", + target_value: "0", + }), + type: DatadogAPIClient::V1::SyntheticsAssertionType::BODY, + }), + ], + config_variables: [ + DatadogAPIClient::V1::SyntheticsConfigVariable.new({ + example: "content-type", + name: "PROPERTY", + pattern: "content-type", + type: DatadogAPIClient::V1::SyntheticsConfigVariableType::TEXT, + }), + ], + request: DatadogAPIClient::V1::SyntheticsTestRequest.new({ + certificate: DatadogAPIClient::V1::SyntheticsTestRequestCertificate.new({ + cert: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({ + content: "cert-content", + filename: "cert-filename", + updated_at: "2020-10-16T09:23:24.857Z", + }), + key: DatadogAPIClient::V1::SyntheticsTestRequestCertificateItem.new({ + content: "key-content", + filename: "key-filename", + updated_at: "2020-10-16T09:23:24.857Z", + }), + }), + headers: DatadogAPIClient::V1::SyntheticsTestHeaders.new({ + unique: "examplecreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse", + }), + method: DatadogAPIClient::V1::HTTPMethod::GET, + timeout: 10, + url: "https://datadoghq.com", + proxy: DatadogAPIClient::V1::SyntheticsTestRequestProxy.new({ + url: "https://datadoghq.com", + headers: DatadogAPIClient::V1::SyntheticsTestHeaders.new({}), + }), + }), + }), + locations: [ + "aws:us-east-2", + ], + message: "BDD test payload: synthetics_api_http_test_payload.json", + name: "Example-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response", + options: DatadogAPIClient::V1::SyntheticsTestOptions.new({ + accept_self_signed: false, + allow_insecure: true, + follow_redirects: true, + min_failure_duration: 10, + min_location_failed: 1, + monitor_name: "Example-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response", + monitor_priority: 5, + _retry: DatadogAPIClient::V1::SyntheticsTestOptionsRetry.new({ + count: 3, + interval: 10, + }), + tick_every: 60, + }), + subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::HTTP, + tags: [ + "testing:api", + ], + type: DatadogAPIClient::V1::SyntheticsAPITestType::API, +}) +p api_instance.create_synthetics_api_test(body) diff --git a/features/v1/given.json b/features/v1/given.json index 6b71c9f11d00..5fc1570633fc 100644 --- a/features/v1/given.json +++ b/features/v1/given.json @@ -123,7 +123,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"config\": {\n \"assertions\": [\n {\n \"operator\": \"is\",\n \"property\": \"{{ '{{ PROPERTY }}' }}\",\n \"target\": \"text/html\",\n \"type\": \"header\"\n },\n { \"operator\": \"lessThan\", \"target\": 2000, \"type\": \"responseTime\" },\n {\n \"operator\": \"validatesJSONPath\",\n \"target\": {\n \"jsonPath\": \"topKey\",\n \"operator\": \"isNot\",\n \"targetValue\": \"0\"\n },\n \"type\": \"body\"\n }\n ],\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"request\": {\n \"certificate\": {\n \"cert\": {\n \"content\": \"cert-content\",\n \"filename\": \"cert-filename\",\n \"updatedAt\": \"2020-10-16T09:23:24.857Z\"\n },\n \"key\": {\n \"content\": \"key-content\",\n \"filename\": \"key-filename\",\n \"updatedAt\": \"2020-10-16T09:23:24.857Z\"\n }\n },\n \"headers\": { \"unique\": \"{{ unique_lower_alnum }}\" },\n \"method\": \"GET\",\n \"timeout\": 10,\n \"url\": \"https://datadoghq.com\",\n \"proxy\": {\n \"url\": \"https://datadoghq.com\",\n \"headers\": {}\n }\n }\n },\n \"locations\": [\"aws:us-east-2\"],\n \"message\": \"BDD test payload: synthetics_api_test_payload.json\",\n \"name\": \"{{ unique }}\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": true,\n \"follow_redirects\": true,\n \"min_failure_duration\": 10,\n \"min_location_failed\": 1,\n \"monitor_name\": \"{{ unique }}\",\n \"monitor_priority\": 5,\n \"retry\": { \"count\": 3, \"interval\": 10 },\n \"tick_every\": 60\n },\n \"subtype\": \"http\",\n \"tags\": [\"testing:api\"],\n \"type\": \"api\"\n}\n" + "value": "{\n \"config\": {\n \"assertions\": [\n {\n \"operator\": \"is\",\n \"property\": \"{{ '{{ PROPERTY }}' }}\",\n \"target\": \"text/html\",\n \"type\": \"header\"\n },\n { \"operator\": \"lessThan\", \"target\": 2000, \"type\": \"responseTime\" },\n {\n \"operator\": \"validatesJSONPath\",\n \"target\": {\n \"jsonPath\": \"topKey\",\n \"operator\": \"isNot\",\n \"targetValue\": \"0\"\n },\n \"type\": \"body\"\n }\n ],\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"request\": {\n \"certificate\": {\n \"cert\": {\n \"content\": \"cert-content\",\n \"filename\": \"cert-filename\",\n \"updatedAt\": \"2020-10-16T09:23:24.857Z\"\n },\n \"key\": {\n \"content\": \"key-content\",\n \"filename\": \"key-filename\",\n \"updatedAt\": \"2020-10-16T09:23:24.857Z\"\n }\n },\n \"headers\": { \"unique\": \"{{ unique_lower_alnum }}\" },\n \"method\": \"GET\",\n \"timeout\": 10,\n \"url\": \"https://datadoghq.com\",\n \"proxy\": {\n \"url\": \"https://datadoghq.com\",\n \"headers\": {}\n }\n }\n },\n \"locations\": [\"aws:us-east-2\"],\n \"message\": \"BDD test payload: synthetics_api_http_test_payload.json\",\n \"name\": \"{{ unique }}\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": true,\n \"follow_redirects\": true,\n \"min_failure_duration\": 10,\n \"min_location_failed\": 1,\n \"monitor_name\": \"{{ unique }}\",\n \"monitor_priority\": 5,\n \"retry\": { \"count\": 3, \"interval\": 10 },\n \"tick_every\": 60\n },\n \"subtype\": \"http\",\n \"tags\": [\"testing:api\"],\n \"type\": \"api\"\n}\n" } ], "step": "there is a valid \"synthetics_api_test\" in the system", diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index 0053937a0035..12cf698e6982 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": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -49,7 +49,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": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} When the request is sent Then the response status is 402 Test quota is reached @@ -88,25 +88,40 @@ Feature: Synthetics When the request is sent Then the response status is 402 Quota reached for private locations + @team:DataDog/synthetics-app + Scenario: Create an API HTTP test returns "OK - Returns the created test details." response + Given new "CreateSyntheticsAPITest" request + And body from file "synthetics_api_http_test_payload.json" + When the request is sent + Then the response status is 200 OK - Returns the created test details. + And the response "name" is equal to "{{ unique }}" + + @team:DataDog/synthetics-app + Scenario: Create an API SSL test returns "OK - Returns the created test details." response + Given new "CreateSyntheticsAPITest" request + And body from file "synthetics_api_ssl_test_payload.json" + When the request is sent + Then the response status is 200 OK - Returns the created test details. + And the response "name" is equal to "{{ unique }}" + @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": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "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": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 400 - JSON format is wrong - @team:DataDog/synthetics-app + @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 from file "synthetics_api_test_payload.json" + 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": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "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. - And the response "name" is equal to "{{ unique }}" @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": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "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": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 402 Test quota is reached @@ -198,7 +213,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": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -206,7 +221,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": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user @@ -214,7 +229,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": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}], "request": {"allow_insecure": null, "basicAuth": {"password": "", "type": "web", "username": ""}, "body": null, "certificate": {"cert": {"content": null, "filename": null, "updatedAt": null}, "key": {"content": null, "filename": null, "updatedAt": null}}, "dnsServer": null, "dnsServerPort": null, "follow_redirects": null, "headers": null, "host": null, "message": null, "method": "GET", "noSavingResponseBody": null, "numberOfPackets": null, "port": null, "proxy": {"headers": null, "url": "https://example.com"}, "query": null, "servername": null, "shouldTrackHops": null, "timeout": null, "url": "https://example.com"}, "setCookie": null, "variables": [{"example": null, "id": null, "name": "VARIABLE_NAME", "pattern": null, "type": "text"}]}, "locations": ["example-location"], "message": "", "name": "Example test name", "options": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "steps": [{"allowFailure": null, "isCritical": null, "name": null, "params": null, "timeout": null, "type": "assertElementContent"}], "tags": [null], "type": "browser"} When the request is sent Then the response status is 200 OK @@ -254,7 +269,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": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "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": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -262,7 +277,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": {"accept_self_signed": null, "allow_insecure": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "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": {"accept_self_signed": null, "allow_insecure": null, "checkCertificateRevocation": null, "device_ids": ["laptop_large"], "disableCors": null, "follow_redirects": null, "min_failure_duration": null, "min_location_failed": null, "monitor_name": null, "monitor_options": {"renotify_interval": null}, "monitor_priority": null, "noScreenshot": null, "retry": {"count": null, "interval": null}, "tick_every": null}, "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_api_http_test_payload.json b/features/v1/synthetics_api_http_test_payload.json new file mode 100644 index 000000000000..d54303a45ed6 --- /dev/null +++ b/features/v1/synthetics_api_http_test_payload.json @@ -0,0 +1,69 @@ +{ + "config": { + "assertions": [ + { + "operator": "is", + "property": "{{ '{{ PROPERTY }}' }}", + "target": "text/html", + "type": "header" + }, + { "operator": "lessThan", "target": 2000, "type": "responseTime" }, + { + "operator": "validatesJSONPath", + "target": { + "jsonPath": "topKey", + "operator": "isNot", + "targetValue": "0" + }, + "type": "body" + } + ], + "configVariables": [ + { + "example": "content-type", + "name": "PROPERTY", + "pattern": "content-type", + "type": "text" + } + ], + "request": { + "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": "{{ unique_lower_alnum }}" }, + "method": "GET", + "timeout": 10, + "url": "https://datadoghq.com", + "proxy": { + "url": "https://datadoghq.com", + "headers": {} + } + } + }, + "locations": ["aws:us-east-2"], + "message": "BDD test payload: synthetics_api_http_test_payload.json", + "name": "{{ unique }}", + "options": { + "accept_self_signed": false, + "allow_insecure": true, + "follow_redirects": true, + "min_failure_duration": 10, + "min_location_failed": 1, + "monitor_name": "{{ unique }}", + "monitor_priority": 5, + "retry": { "count": 3, "interval": 10 }, + "tick_every": 60 + }, + "subtype": "http", + "tags": ["testing:api"], + "type": "api" +} diff --git a/features/v1/synthetics_api_ssl_test_payload.json b/features/v1/synthetics_api_ssl_test_payload.json new file mode 100644 index 000000000000..1c75cd299150 --- /dev/null +++ b/features/v1/synthetics_api_ssl_test_payload.json @@ -0,0 +1,26 @@ +{ + "config": { + "assertions": [ + { + "operator": "isInMoreThan", + "target": 10, + "type": "certificate" + } + ], + "request": { + "host": "datadoghq.com", + "port": 443 + } + }, + "locations": ["aws:us-east-2"], + "message": "BDD test payload: synthetics_api_ssl_test_payload.json", + "name": "{{ unique }}", + "options": { + "accept_self_signed": true, + "checkCertificateRevocation": true, + "tick_every": 60 + }, + "subtype": "ssl", + "tags": ["testing:api"], + "type": "api" +} diff --git a/lib/datadog_api_client/v1/models/synthetics_test_options.rb b/lib/datadog_api_client/v1/models/synthetics_test_options.rb index de9c55159a59..275c46744764 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_options.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_options.rb @@ -30,6 +30,9 @@ class SyntheticsTestOptions # Allows loading insecure content for an HTTP request. attr_accessor :allow_insecure + # For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP. + attr_accessor :check_certificate_revocation + # For browser test, array with the different device IDs used to run the test. attr_accessor :device_ids @@ -71,6 +74,7 @@ def self.attribute_map { :'accept_self_signed' => :'accept_self_signed', :'allow_insecure' => :'allow_insecure', + :'check_certificate_revocation' => :'checkCertificateRevocation', :'device_ids' => :'device_ids', :'disable_cors' => :'disableCors', :'follow_redirects' => :'follow_redirects', @@ -97,6 +101,7 @@ def self.openapi_types { :'accept_self_signed' => :'Boolean', :'allow_insecure' => :'Boolean', + :'check_certificate_revocation' => :'Boolean', :'device_ids' => :'Array', :'disable_cors' => :'Boolean', :'follow_redirects' => :'Boolean', @@ -142,6 +147,10 @@ def initialize(attributes = {}) self.allow_insecure = attributes[:'allow_insecure'] end + if attributes.key?(:'check_certificate_revocation') + self.check_certificate_revocation = attributes[:'check_certificate_revocation'] + end + if attributes.key?(:'device_ids') if (value = attributes[:'device_ids']).is_a?(Array) self.device_ids = value @@ -254,6 +263,7 @@ def ==(o) self.class == o.class && accept_self_signed == o.accept_self_signed && allow_insecure == o.allow_insecure && + check_certificate_revocation == o.check_certificate_revocation && device_ids == o.device_ids && disable_cors == o.disable_cors && follow_redirects == o.follow_redirects && @@ -278,7 +288,7 @@ def eql?(o) # @return [Integer] Hash code # @!visibility private def hash - [accept_self_signed, allow_insecure, device_ids, disable_cors, follow_redirects, min_failure_duration, min_location_failed, monitor_name, monitor_options, monitor_priority, no_screenshot, _retry, tick_every].hash + [accept_self_signed, allow_insecure, check_certificate_revocation, device_ids, disable_cors, follow_redirects, min_failure_duration, min_location_failed, monitor_name, monitor_options, monitor_priority, no_screenshot, _retry, tick_every].hash end # Builds the object from hash