diff --git a/.apigentools-info b/.apigentools-info index d2d3d5ae45..16c42c9400 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-06-07 12:30:49.616759", - "spec_repo_commit": "93296fc6" + "regenerated": "2024-06-10 14:07:14.105607", + "spec_repo_commit": "eaf0da43" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-06-07 12:30:49.634620", - "spec_repo_commit": "93296fc6" + "regenerated": "2024-06-10 14:07:14.122767", + "spec_repo_commit": "eaf0da43" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 67a52c4bc0..e6878d4cd6 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -13693,9 +13693,45 @@ components: which property they apply, and upon which target.' oneOf: - $ref: '#/components/schemas/SyntheticsAssertionTarget' + - $ref: '#/components/schemas/SyntheticsAssertionBodyHashTarget' - $ref: '#/components/schemas/SyntheticsAssertionJSONPathTarget' - $ref: '#/components/schemas/SyntheticsAssertionJSONSchemaTarget' - $ref: '#/components/schemas/SyntheticsAssertionXPathTarget' + SyntheticsAssertionBodyHashOperator: + description: Assertion operator to apply. + enum: + - md5 + - sha1 + - sha256 + example: md5 + type: string + x-enum-varnames: + - MD5 + - SHA1 + - SHA256 + SyntheticsAssertionBodyHashTarget: + description: An assertion which targets body hash. + properties: + operator: + $ref: '#/components/schemas/SyntheticsAssertionBodyHashOperator' + target: + description: Value used by the operator. + example: 123456 + type: + $ref: '#/components/schemas/SyntheticsAssertionBodyHashType' + required: + - type + - operator + - target + type: object + SyntheticsAssertionBodyHashType: + description: Type of the assertion. + enum: + - bodyHash + example: bodyHash + type: string + x-enum-varnames: + - BODY_HASH SyntheticsAssertionJSONPathOperator: description: Assertion operator to apply. enum: diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 28e199f9ae..3632b98d6f 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -3858,6 +3858,27 @@ synthetics\_assertion :members: :show-inheritance: +synthetics\_assertion\_body\_hash\_operator +------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.synthetics_assertion_body_hash_operator + :members: + :show-inheritance: + +synthetics\_assertion\_body\_hash\_target +----------------------------------------- + +.. automodule:: datadog_api_client.v1.model.synthetics_assertion_body_hash_target + :members: + :show-inheritance: + +synthetics\_assertion\_body\_hash\_type +--------------------------------------- + +.. automodule:: datadog_api_client.v1.model.synthetics_assertion_body_hash_type + :members: + :show-inheritance: + synthetics\_assertion\_json\_path\_operator ------------------------------------------- diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.py b/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.py index 8a6f5d351e..1f59ed25ae 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.py +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.py @@ -7,6 +7,9 @@ from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType +from datadog_api_client.v1.model.synthetics_assertion_body_hash_operator import SyntheticsAssertionBodyHashOperator +from datadog_api_client.v1.model.synthetics_assertion_body_hash_target import SyntheticsAssertionBodyHashTarget +from datadog_api_client.v1.model.synthetics_assertion_body_hash_type import SyntheticsAssertionBodyHashType from datadog_api_client.v1.model.synthetics_assertion_json_path_operator import SyntheticsAssertionJSONPathOperator from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_path_target_target import ( @@ -85,6 +88,11 @@ ), type=SyntheticsAssertionType.BODY, ), + SyntheticsAssertionBodyHashTarget( + operator=SyntheticsAssertionBodyHashOperator.MD5, + target="a", + type=SyntheticsAssertionBodyHashType.BODY_HASH, + ), ], config_variables=[ SyntheticsConfigVariable( diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.py b/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.py new file mode 100644 index 0000000000..20b30748c3 --- /dev/null +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1987645492.py @@ -0,0 +1,174 @@ +""" +Create an API HTTP test has bodyHash filled out +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.synthetics_api import SyntheticsApi +from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest +from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig +from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType +from datadog_api_client.v1.model.synthetics_assertion_body_hash_operator import SyntheticsAssertionBodyHashOperator +from datadog_api_client.v1.model.synthetics_assertion_body_hash_target import SyntheticsAssertionBodyHashTarget +from datadog_api_client.v1.model.synthetics_assertion_body_hash_type import SyntheticsAssertionBodyHashType +from datadog_api_client.v1.model.synthetics_assertion_json_path_operator import SyntheticsAssertionJSONPathOperator +from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget +from datadog_api_client.v1.model.synthetics_assertion_json_path_target_target import ( + SyntheticsAssertionJSONPathTargetTarget, +) +from datadog_api_client.v1.model.synthetics_assertion_json_schema_meta_schema import ( + SyntheticsAssertionJSONSchemaMetaSchema, +) +from datadog_api_client.v1.model.synthetics_assertion_json_schema_operator import SyntheticsAssertionJSONSchemaOperator +from datadog_api_client.v1.model.synthetics_assertion_json_schema_target import SyntheticsAssertionJSONSchemaTarget +from datadog_api_client.v1.model.synthetics_assertion_json_schema_target_target import ( + SyntheticsAssertionJSONSchemaTargetTarget, +) +from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator +from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget +from datadog_api_client.v1.model.synthetics_assertion_timings_scope import SyntheticsAssertionTimingsScope +from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType +from datadog_api_client.v1.model.synthetics_assertion_x_path_operator import SyntheticsAssertionXPathOperator +from datadog_api_client.v1.model.synthetics_assertion_x_path_target import SyntheticsAssertionXPathTarget +from datadog_api_client.v1.model.synthetics_assertion_x_path_target_target import SyntheticsAssertionXPathTargetTarget +from datadog_api_client.v1.model.synthetics_basic_auth_oauth_client import SyntheticsBasicAuthOauthClient +from datadog_api_client.v1.model.synthetics_basic_auth_oauth_client_type import SyntheticsBasicAuthOauthClientType +from datadog_api_client.v1.model.synthetics_basic_auth_oauth_token_api_authentication import ( + SyntheticsBasicAuthOauthTokenApiAuthentication, +) +from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable +from datadog_api_client.v1.model.synthetics_config_variable_type import SyntheticsConfigVariableType +from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType +from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders +from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions +from datadog_api_client.v1.model.synthetics_test_options_http_version import SyntheticsTestOptionsHTTPVersion +from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry +from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest +from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate +from datadog_api_client.v1.model.synthetics_test_request_certificate_item import SyntheticsTestRequestCertificateItem +from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy + +body = SyntheticsAPITest( + config=SyntheticsAPITestConfig( + assertions=[ + SyntheticsAssertionTarget( + operator=SyntheticsAssertionOperator.IS, + _property="{{ PROPERTY }}", + target="text/html", + type=SyntheticsAssertionType.HEADER, + ), + SyntheticsAssertionTarget( + operator=SyntheticsAssertionOperator.LESS_THAN, + target=2000, + type=SyntheticsAssertionType.RESPONSE_TIME, + timings_scope=SyntheticsAssertionTimingsScope.WITHOUT_DNS, + ), + SyntheticsAssertionJSONPathTarget( + operator=SyntheticsAssertionJSONPathOperator.VALIDATES_JSON_PATH, + target=SyntheticsAssertionJSONPathTargetTarget( + json_path="topKey", + operator="isNot", + target_value="0", + ), + type=SyntheticsAssertionType.BODY, + ), + SyntheticsAssertionJSONSchemaTarget( + operator=SyntheticsAssertionJSONSchemaOperator.VALIDATES_JSON_SCHEMA, + target=SyntheticsAssertionJSONSchemaTargetTarget( + meta_schema=SyntheticsAssertionJSONSchemaMetaSchema.DRAFT_07, + json_schema='{"type": "object", "properties":{"slideshow":{"type":"object"}}}', + ), + type=SyntheticsAssertionType.BODY, + ), + SyntheticsAssertionXPathTarget( + operator=SyntheticsAssertionXPathOperator.VALIDATES_X_PATH, + target=SyntheticsAssertionXPathTargetTarget( + x_path="target-xpath", + target_value="0", + operator="contains", + ), + type=SyntheticsAssertionType.BODY, + ), + SyntheticsAssertionBodyHashTarget( + operator=SyntheticsAssertionBodyHashOperator.MD5, + target="a", + type=SyntheticsAssertionBodyHashType.BODY_HASH, + ), + ], + config_variables=[ + SyntheticsConfigVariable( + example="content-type", + name="PROPERTY", + pattern="content-type", + type=SyntheticsConfigVariableType.TEXT, + ), + ], + variables_from_script='dd.variable.set("FOO", "foo")', + request=SyntheticsTestRequest( + certificate=SyntheticsTestRequestCertificate( + cert=SyntheticsTestRequestCertificateItem( + content="cert-content", + filename="cert-filename", + updated_at="2020-10-16T09:23:24.857Z", + ), + key=SyntheticsTestRequestCertificateItem( + content="key-content", + filename="key-filename", + updated_at="2020-10-16T09:23:24.857Z", + ), + ), + headers=SyntheticsTestHeaders( + unique="examplesynthetic", + ), + method="GET", + timeout=10.0, + url="https://datadoghq.com", + proxy=SyntheticsTestRequestProxy( + url="https://datadoghq.com", + headers=SyntheticsTestHeaders(), + ), + basic_auth=SyntheticsBasicAuthOauthClient( + access_token_url="https://datadog-token.com", + audience="audience", + client_id="client-id", + client_secret="client-secret", + resource="resource", + scope="yoyo", + token_api_authentication=SyntheticsBasicAuthOauthTokenApiAuthentication.HEADER, + type=SyntheticsBasicAuthOauthClientType.OAUTH_CLIENT, + ), + persist_cookies=True, + ), + ), + locations=[ + "aws:us-east-2", + ], + message="BDD test payload: synthetics_api_http_test_payload.json", + name="Example-Synthetic", + options=SyntheticsTestOptions( + accept_self_signed=False, + allow_insecure=True, + follow_redirects=True, + min_failure_duration=10, + min_location_failed=1, + monitor_name="Example-Synthetic", + monitor_priority=5, + retry=SyntheticsTestOptionsRetry( + count=3, + interval=10.0, + ), + tick_every=60, + http_version=SyntheticsTestOptionsHTTPVersion.HTTP2, + ), + subtype=SyntheticsTestDetailsSubType.HTTP, + tags=[ + "testing:api", + ], + type=SyntheticsAPITestType.API, +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.create_synthetics_api_test(body=body) + + print(response) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_config.py b/src/datadog_api_client/v1/model/synthetics_api_test_config.py index d0f2b5866b..9249ef007d 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_config.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_config.py @@ -19,6 +19,7 @@ from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest from datadog_api_client.v1.model.synthetics_api_step import SyntheticsAPIStep from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget + from datadog_api_client.v1.model.synthetics_assertion_body_hash_target import SyntheticsAssertionBodyHashTarget from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_schema_target import SyntheticsAssertionJSONSchemaTarget from datadog_api_client.v1.model.synthetics_assertion_x_path_target import SyntheticsAssertionXPathTarget @@ -55,6 +56,7 @@ def __init__( Union[ SyntheticsAssertion, SyntheticsAssertionTarget, + SyntheticsAssertionBodyHashTarget, SyntheticsAssertionJSONPathTarget, SyntheticsAssertionJSONSchemaTarget, SyntheticsAssertionXPathTarget, diff --git a/src/datadog_api_client/v1/model/synthetics_assertion.py b/src/datadog_api_client/v1/model/synthetics_assertion.py index 3a769279e6..0767a415b5 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion.py @@ -43,6 +43,7 @@ def _composed_schemas(_): # classes don't exist yet because their module has not finished # loading from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget + from datadog_api_client.v1.model.synthetics_assertion_body_hash_target import SyntheticsAssertionBodyHashTarget from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_schema_target import ( SyntheticsAssertionJSONSchemaTarget, @@ -52,6 +53,7 @@ def _composed_schemas(_): return { "oneOf": [ SyntheticsAssertionTarget, + SyntheticsAssertionBodyHashTarget, SyntheticsAssertionJSONPathTarget, SyntheticsAssertionJSONSchemaTarget, SyntheticsAssertionXPathTarget, diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_operator.py b/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_operator.py new file mode 100644 index 0000000000..79edb2fd84 --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_operator.py @@ -0,0 +1,41 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SyntheticsAssertionBodyHashOperator(ModelSimple): + """ + Assertion operator to apply. + + :param value: Must be one of ["md5", "sha1", "sha256"]. + :type value: str + """ + + allowed_values = { + "md5", + "sha1", + "sha256", + } + MD5: ClassVar["SyntheticsAssertionBodyHashOperator"] + SHA1: ClassVar["SyntheticsAssertionBodyHashOperator"] + SHA256: ClassVar["SyntheticsAssertionBodyHashOperator"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsAssertionBodyHashOperator.MD5 = SyntheticsAssertionBodyHashOperator("md5") +SyntheticsAssertionBodyHashOperator.SHA1 = SyntheticsAssertionBodyHashOperator("sha1") +SyntheticsAssertionBodyHashOperator.SHA256 = SyntheticsAssertionBodyHashOperator("sha256") diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_target.py b/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_target.py new file mode 100644 index 0000000000..8809393dab --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_target.py @@ -0,0 +1,77 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.synthetics_assertion_body_hash_operator import SyntheticsAssertionBodyHashOperator + from datadog_api_client.v1.model.synthetics_assertion_body_hash_type import SyntheticsAssertionBodyHashType + + +class SyntheticsAssertionBodyHashTarget(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.synthetics_assertion_body_hash_operator import ( + SyntheticsAssertionBodyHashOperator, + ) + from datadog_api_client.v1.model.synthetics_assertion_body_hash_type import SyntheticsAssertionBodyHashType + + return { + "operator": (SyntheticsAssertionBodyHashOperator,), + "target": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ), + "type": (SyntheticsAssertionBodyHashType,), + } + + attribute_map = { + "operator": "operator", + "target": "target", + "type": "type", + } + + def __init__( + self_, + operator: SyntheticsAssertionBodyHashOperator, + target: Any, + type: SyntheticsAssertionBodyHashType, + **kwargs, + ): + """ + An assertion which targets body hash. + + :param operator: Assertion operator to apply. + :type operator: SyntheticsAssertionBodyHashOperator + + :param target: Value used by the operator. + :type target: bool, date, datetime, dict, float, int, list, str, UUID, none_type + + :param type: Type of the assertion. + :type type: SyntheticsAssertionBodyHashType + """ + super().__init__(kwargs) + + self_.operator = operator + self_.target = target + self_.type = type diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_type.py b/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_type.py new file mode 100644 index 0000000000..f39bfdb590 --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_assertion_body_hash_type.py @@ -0,0 +1,35 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SyntheticsAssertionBodyHashType(ModelSimple): + """ + Type of the assertion. + + :param value: If omitted defaults to "bodyHash". Must be one of ["bodyHash"]. + :type value: str + """ + + allowed_values = { + "bodyHash", + } + BODY_HASH: ClassVar["SyntheticsAssertionBodyHashType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsAssertionBodyHashType.BODY_HASH = SyntheticsAssertionBodyHashType("bodyHash") diff --git a/src/datadog_api_client/v1/model/synthetics_test_config.py b/src/datadog_api_client/v1/model/synthetics_test_config.py index 06d7544896..28fd45a058 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_config.py +++ b/src/datadog_api_client/v1/model/synthetics_test_config.py @@ -19,6 +19,7 @@ from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest from datadog_api_client.v1.model.synthetics_browser_variable import SyntheticsBrowserVariable from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget + from datadog_api_client.v1.model.synthetics_assertion_body_hash_target import SyntheticsAssertionBodyHashTarget from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_schema_target import SyntheticsAssertionJSONSchemaTarget from datadog_api_client.v1.model.synthetics_assertion_x_path_target import SyntheticsAssertionXPathTarget @@ -53,6 +54,7 @@ def __init__( Union[ SyntheticsAssertion, SyntheticsAssertionTarget, + SyntheticsAssertionBodyHashTarget, SyntheticsAssertionJSONPathTarget, SyntheticsAssertionJSONSchemaTarget, SyntheticsAssertionXPathTarget, diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 258eaa764c..bbe0067e46 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -621,6 +621,9 @@ from datadog_api_client.v1.model.synthetics_api_test_failure_code import SyntheticsApiTestFailureCode from datadog_api_client.v1.model.synthetics_api_test_result_failure import SyntheticsApiTestResultFailure from datadog_api_client.v1.model.synthetics_assertion import SyntheticsAssertion +from datadog_api_client.v1.model.synthetics_assertion_body_hash_operator import SyntheticsAssertionBodyHashOperator +from datadog_api_client.v1.model.synthetics_assertion_body_hash_target import SyntheticsAssertionBodyHashTarget +from datadog_api_client.v1.model.synthetics_assertion_body_hash_type import SyntheticsAssertionBodyHashType from datadog_api_client.v1.model.synthetics_assertion_json_path_operator import SyntheticsAssertionJSONPathOperator from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget from datadog_api_client.v1.model.synthetics_assertion_json_path_target_target import ( @@ -1526,6 +1529,9 @@ "SyntheticsApiTestFailureCode", "SyntheticsApiTestResultFailure", "SyntheticsAssertion", + "SyntheticsAssertionBodyHashOperator", + "SyntheticsAssertionBodyHashTarget", + "SyntheticsAssertionBodyHashType", "SyntheticsAssertionJSONPathOperator", "SyntheticsAssertionJSONPathTarget", "SyntheticsAssertionJSONPathTargetTarget", diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.frozen b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.frozen new file mode 100644 index 0000000000..3fc9bf0a78 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.frozen @@ -0,0 +1 @@ +2024-06-10T13:58:21.100Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.yaml b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.yaml new file mode 100644 index 0000000000..0b75b7e646 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_has_bodyhash_filled_out.yaml @@ -0,0 +1,45 @@ +interactions: +- request: + body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptesthasbodyhashfilledout1718027901"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1718027901","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1718027901","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/api + response: + body: + string: '{"public_id":"4wa-kdy-hav","name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1718027901","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-10T13:58:21.435520+00:00","modified_at":"2024-06-10T13:58:21.435520+00:00","config":{"assertions":[{"operator":"is","property":"{{ + PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptesthasbodyhashfilledout1718027901"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_has_bodyHash_filled_out-1718027901","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":146763214,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"public_ids":["4wa-kdy-hav"]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete + response: + body: + string: '{"deleted_tests":[{"public_id":"4wa-kdy-hav","deleted_at":"2024-06-10T13:58:21.869172+00:00"}]} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.frozen b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.frozen index 2b4b8f26ff..0324401324 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.frozen @@ -1 +1 @@ -2024-04-19T18:06:12.804Z \ No newline at end of file +2024-06-07T17:11:09.476Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.yaml b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.yaml index 665b9b1c58..1cc2448900 100644 --- a/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_create_an_api_http_test_returns_ok_returns_the_created_test_details_response.yaml @@ -1,8 +1,8 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1713549972"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"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-1713549972","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1713549972","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1717780269"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"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-1717780269","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1717780269","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +12,12 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"ati-q5f-9w7","name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1713549972","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-04-19T18:06:13.121082+00:00","modified_at":"2024-04-19T18:06:13.121082+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"g9k-dug-9pv","name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1717780269","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-07T17:11:09.832987+00:00","modified_at":"2024-06-07T17:11:09.832987+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1713549972"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1713549972","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":143517847,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1717780269"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1717780269","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":146628225,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' headers: content-type: - application/json @@ -23,7 +25,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["ati-q5f-9w7"]}' + body: '{"public_ids":["g9k-dug-9pv"]}' headers: accept: - application/json @@ -33,7 +35,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"ati-q5f-9w7","deleted_at":"2024-04-19T18:06:13.894695+00:00"}]} + string: '{"deleted_tests":[{"public_id":"g9k-dug-9pv","deleted_at":"2024-06-07T17:11:10.468549+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.frozen index 3605f82557..018e424484 100644 --- a/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.frozen @@ -1 +1 @@ -2024-04-19T18:06:14.032Z \ No newline at end of file +2024-06-07T17:11:10.874Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.yaml index 3d529e1d5d..8f21dcd2ca 100644 --- a/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_edit_an_api_test_returns_ok_response.yaml @@ -1,8 +1,8 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1713549974"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1713549974","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1713549974","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1717780270"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Edit_an_API_test_returns_OK_response-1717780270","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1717780270","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +12,12 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"xrn-jgn-wrk","name":"Test-Edit_an_API_test_returns_OK_response-1713549974","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-04-19T18:06:14.401191+00:00","modified_at":"2024-04-19T18:06:14.401191+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"e95-8kp-s23","name":"Test-Edit_an_API_test_returns_OK_response-1717780270","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-07T17:11:11.234895+00:00","modified_at":"2024-06-07T17:11:11.234895+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1713549974"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1713549974","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":143517848,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1717780270"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Edit_an_API_test_returns_OK_response-1717780270","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":146628226,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' headers: content-type: - application/json @@ -24,21 +26,23 @@ interactions: message: OK - request: body: '{"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"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"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":"testeditanapitestreturnsokresponse1713549974"},"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-1713549974-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"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"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":"testeditanapitestreturnsokresponse1717780270"},"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-1717780270-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: accept: - application/json content-type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v1/synthetics/tests/api/xrn-jgn-wrk + uri: https://api.datadoghq.com/api/v1/synthetics/tests/api/e95-8kp-s23 response: body: - string: '{"public_id":"xrn-jgn-wrk","name":"Test-Edit_an_API_test_returns_OK_response-1713549974-updated","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-04-19T18:06:14.401191+00:00","modified_at":"2024-04-19T18:06:14.817541+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"e95-8kp-s23","name":"Test-Edit_an_API_test_returns_OK_response-1717780270-updated","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-07T17:11:11.234895+00:00","modified_at":"2024-06-07T17:11:12.135111+00:00","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"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1713549974"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"message":"BDD - test payload: synthetics_api_test_payload.json","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},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":143517848,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testeditanapitestreturnsokresponse1717780270"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"message":"BDD + test payload: synthetics_api_test_payload.json","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},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":146628226,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' headers: content-type: - application/json @@ -46,7 +50,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["xrn-jgn-wrk"]}' + body: '{"public_ids":["e95-8kp-s23"]}' headers: accept: - application/json @@ -56,7 +60,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"xrn-jgn-wrk","deleted_at":"2024-04-19T18:06:16.249117+00:00"}]} + string: '{"deleted_tests":[{"public_id":"e95-8kp-s23","deleted_at":"2024-06-07T17:11:12.756956+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.frozen b/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.frozen index be62d4b7b2..07063790f6 100644 --- a/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.frozen +++ b/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.frozen @@ -1 +1 @@ -2024-04-19T18:06:11.007Z \ No newline at end of file +2024-06-07T17:11:07.876Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.yaml b/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.yaml index 77a7332497..5f1d4f6e38 100644 --- a/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.yaml +++ b/tests/v1/cassettes/test_scenarios/test_get_a_synthetics_monitors_details.yaml @@ -1,8 +1,8 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testgetasyntheticsmonitorsdetails1713549971"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Get_a_synthetics_monitor_s_details-1713549971","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1713549971","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testgetasyntheticsmonitorsdetails1717780267"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Get_a_synthetics_monitor_s_details-1717780267","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1717780267","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +12,12 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"vp2-ewh-gtm","name":"Test-Get_a_synthetics_monitor_s_details-1713549971","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-04-19T18:06:11.424005+00:00","modified_at":"2024-04-19T18:06:11.424005+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"345-34e-6z9","name":"Test-Get_a_synthetics_monitor_s_details-1717780267","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-07T17:11:08.310477+00:00","modified_at":"2024-06-07T17:11:08.310477+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testgetasyntheticsmonitorsdetails1713549971"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1713549971","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":143517846,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testgetasyntheticsmonitorsdetails1717780267"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Get_a_synthetics_monitor_s_details-1717780267","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":146628223,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' headers: content-type: - application/json @@ -28,12 +30,12 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v1/monitor/143517846 + uri: https://api.datadoghq.com/api/v1/monitor/146628223 response: body: - string: '{"id":143517846,"org_id":321813,"type":"synthetics alert","name":"Test-Get_a_synthetics_monitor_s_details-1713549971","message":"BDD - test payload: synthetics_api_http_test_payload.json","tags":["testing:api","probe_dc:aws:us-east-2","check_type:api","check_status:live","ci_execution_rule:blocking"],"query":"no_query","options":{"on_missing_data":"show_no_data","notify_audit":false,"new_host_delay":300,"include_tags":true,"synthetics_check_id":"vp2-ewh-gtm","silenced":{}},"multi":false,"created_at":1713549971000,"created":"2024-04-19T18:06:11.399838+00:00","modified":"2024-04-19T18:06:11.399838+00:00","deleted":null,"restricted_roles":null,"priority":5,"overall_state_modified":null,"overall_state":"No - Data","creator":{"name":null,"email":"frog@datadoghq.com","handle":"frog@datadoghq.com","id":1445416}} + string: '{"id":146628223,"org_id":321813,"type":"synthetics alert","name":"Test-Get_a_synthetics_monitor_s_details-1717780267","message":"BDD + test payload: synthetics_api_http_test_payload.json","tags":["testing:api","probe_dc:aws:us-east-2","check_type:api","check_status:live","ci_execution_rule:blocking"],"query":"no_query","options":{"on_missing_data":"show_no_data","notify_audit":false,"new_host_delay":300,"include_tags":true,"synthetics_check_id":"345-34e-6z9","silenced":{}},"multi":false,"created_at":1717780268000,"created":"2024-06-07T17:11:08.287753+00:00","modified":"2024-06-07T17:11:08.287753+00:00","deleted":null,"restricted_roles":null,"priority":5,"overall_state_modified":null,"overall_state":"No + Data","creator":{"name":"CI Account","email":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","id":2320499}} ' headers: @@ -43,7 +45,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["vp2-ewh-gtm"]}' + body: '{"public_ids":["345-34e-6z9"]}' headers: accept: - application/json @@ -53,7 +55,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"vp2-ewh-gtm","deleted_at":"2024-04-19T18:06:12.668857+00:00"}]} + string: '{"deleted_tests":[{"public_id":"345-34e-6z9","deleted_at":"2024-06-07T17:11:09.164875+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.frozen index 21bb6d73be..151fdd692d 100644 --- a/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.frozen @@ -1 +1 @@ -2024-04-19T18:06:17.111Z \ No newline at end of file +2024-06-07T17:11:12.906Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.yaml index 2fe13da321..279e2d025e 100644 --- a/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_patch_a_synthetic_test_returns_ok_response.yaml @@ -1,8 +1,8 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1713549977"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Patch_a_Synthetic_test_returns_OK_response-1713549977","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1713549977","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1717780272"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Patch_a_Synthetic_test_returns_OK_response-1717780272","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1717780272","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +12,12 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"csc-m3c-65b","name":"Test-Patch_a_Synthetic_test_returns_OK_response-1713549977","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-04-19T18:06:17.422271+00:00","modified_at":"2024-04-19T18:06:17.422271+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"zba-98n-3nj","name":"Test-Patch_a_Synthetic_test_returns_OK_response-1717780272","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-07T17:11:13.267998+00:00","modified_at":"2024-06-07T17:11:13.267998+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1713549977"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1713549977","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":143517849,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1717780272"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1717780272","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":146628227,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' headers: content-type: - application/json @@ -30,12 +32,14 @@ interactions: content-type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v1/synthetics/tests/csc-m3c-65b + uri: https://api.datadoghq.com/api/v1/synthetics/tests/zba-98n-3nj response: body: - string: '{"public_id":"csc-m3c-65b","name":"New test name","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-04-19T18:06:17.422271+00:00","modified_at":"2024-04-19T18:06:17.857232+00:00","config":{"assertions":[{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1713549977"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1713549977","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":143517849,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + string: '{"public_id":"zba-98n-3nj","name":"New test name","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-07T17:11:13.267998+00:00","modified_at":"2024-06-07T17:11:13.657947+00:00","config":{"assertions":[{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testpatchasynthetictestreturnsokresponse1717780272"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Patch_a_Synthetic_test_returns_OK_response-1717780272","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":146628227,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' headers: content-type: - application/json @@ -43,7 +47,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["csc-m3c-65b"]}' + body: '{"public_ids":["zba-98n-3nj"]}' headers: accept: - application/json @@ -53,7 +57,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"csc-m3c-65b","deleted_at":"2024-04-19T18:06:18.506843+00:00"}]} + string: '{"deleted_tests":[{"public_id":"zba-98n-3nj","deleted_at":"2024-06-07T17:11:14.334270+00:00"}]} ' headers: diff --git a/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.frozen b/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.frozen index ccc6f17e7a..cfa99958f0 100644 --- a/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.frozen +++ b/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.frozen @@ -1 +1 @@ -2024-04-19T18:06:18.874Z \ No newline at end of file +2024-06-07T17:11:14.533Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.yaml b/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.yaml index 95fbf6b634..93506a89c0 100644 --- a/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.yaml +++ b/tests/v1/cassettes/test_scenarios/test_trigger_synthetic_tests_returns_ok_response.yaml @@ -1,8 +1,8 @@ interactions: - request: body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testtriggersynthetictestsreturnsokresponse1713549978"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Trigger_Synthetic_tests_returns_OK_response-1713549978","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetic_tests_returns_OK_response-1713549978","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testtriggersynthetictestsreturnsokresponse1717780274"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Trigger_Synthetic_tests_returns_OK_response-1717780274","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetic_tests_returns_OK_response-1717780274","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' headers: accept: - application/json @@ -12,10 +12,12 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/api response: body: - string: '{"public_id":"4kz-wi9-3gu","name":"Test-Trigger_Synthetic_tests_returns_OK_response-1713549978","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-04-19T18:06:19.222224+00:00","modified_at":"2024-04-19T18:06:19.222224+00:00","config":{"assertions":[{"operator":"is","property":"{{ + string: '{"public_id":"fbg-cs6-aq7","name":"Test-Trigger_Synthetic_tests_returns_OK_response-1717780274","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-06-07T17:11:14.930630+00:00","modified_at":"2024-06-07T17:11:14.930630+00:00","config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": - \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testtriggersynthetictestsreturnsokresponse1713549978"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", - \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetic_tests_returns_OK_response-1713549978","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":143517850,"org_id":321813,"modified_by":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testtriggersynthetictestsreturnsokresponse1717780274"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Trigger_Synthetic_tests_returns_OK_response-1717780274","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":146628228,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' headers: content-type: - application/json @@ -23,7 +25,7 @@ interactions: code: 200 message: OK - request: - body: '{"tests":[{"public_id":"4kz-wi9-3gu"}]}' + body: '{"tests":[{"public_id":"fbg-cs6-aq7"}]}' headers: accept: - application/json @@ -33,7 +35,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/trigger response: body: - string: '{"triggered_check_ids":["4kz-wi9-3gu"],"results":[{"public_id":"4kz-wi9-3gu","location":30005,"result_id":"4058014420339337998"}],"locations":[{"id":30005,"name":"aws:us-east-2","display_name":"Ohio + string: '{"triggered_check_ids":["fbg-cs6-aq7"],"results":[{"public_id":"fbg-cs6-aq7","location":30005,"result_id":"2808787540874411699"}],"locations":[{"id":30005,"name":"aws:us-east-2","display_name":"Ohio (AWS)","region":"Americas","is_active":true,"is_public":true,"metadata":null}],"batch_id":null} ' @@ -44,7 +46,7 @@ interactions: code: 200 message: OK - request: - body: '{"public_ids":["4kz-wi9-3gu"]}' + body: '{"public_ids":["fbg-cs6-aq7"]}' headers: accept: - application/json @@ -54,7 +56,7 @@ interactions: uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: body: - string: '{"deleted_tests":[{"public_id":"4kz-wi9-3gu","deleted_at":"2024-04-19T18:06:19.909119+00:00"}]} + string: '{"deleted_tests":[{"public_id":"fbg-cs6-aq7","deleted_at":"2024-06-07T17:11:17.222801+00:00"}]} ' headers: diff --git a/tests/v1/features/given.json b/tests/v1/features/given.json index 8205ca9ee1..ef843aad2a 100644 --- a/tests/v1/features/given.json +++ b/tests/v1/features/given.json @@ -238,7 +238,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\", \"timingsScope\": \"withoutDNS\" },\n {\n \"operator\": \"validatesJSONPath\",\n \"target\": {\n \"jsonPath\": \"topKey\",\n \"operator\": \"isNot\",\n \"targetValue\": \"0\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesJSONSchema\",\n \"target\": {\n \"metaSchema\": \"draft-07\",\n \"jsonSchema\": \"{\\\"type\\\": \\\"object\\\", \\\"properties\\\":{\\\"slideshow\\\":{\\\"type\\\":\\\"object\\\"}}}\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesXPath\",\n \"target\": {\n \"xPath\": \"target-xpath\",\n \"targetValue\": \"0\",\n \"operator\": \"contains\"\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 \"variablesFromScript\": \"dd.variable.set(\\\"FOO\\\", \\\"foo\\\")\",\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 \"basicAuth\": {\n \"accessTokenUrl\": \"https://datadog-token.com\",\n \"audience\": \"audience\",\n \"clientId\": \"client-id\",\n \"clientSecret\": \"client-secret\",\n \"resource\": \"resource\",\n \"scope\": \"yoyo\",\n \"tokenApiAuthentication\": \"header\",\n \"type\": \"oauth-client\"\n },\n \"persistCookies\": true\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 \"httpVersion\": \"http2\"\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\", \"timingsScope\": \"withoutDNS\" },\n {\n \"operator\": \"validatesJSONPath\",\n \"target\": {\n \"jsonPath\": \"topKey\",\n \"operator\": \"isNot\",\n \"targetValue\": \"0\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesJSONSchema\",\n \"target\": {\n \"metaSchema\": \"draft-07\",\n \"jsonSchema\": \"{\\\"type\\\": \\\"object\\\", \\\"properties\\\":{\\\"slideshow\\\":{\\\"type\\\":\\\"object\\\"}}}\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"validatesXPath\",\n \"target\": {\n \"xPath\": \"target-xpath\",\n \"targetValue\": \"0\",\n \"operator\": \"contains\"\n },\n \"type\": \"body\"\n },\n {\n \"operator\": \"md5\",\n \"target\": \"a\",\n \"type\": \"bodyHash\"\n }\n ],\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"variablesFromScript\": \"dd.variable.set(\\\"FOO\\\", \\\"foo\\\")\",\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 \"basicAuth\": {\n \"accessTokenUrl\": \"https://datadog-token.com\",\n \"audience\": \"audience\",\n \"clientId\": \"client-id\",\n \"clientSecret\": \"client-secret\",\n \"resource\": \"resource\",\n \"scope\": \"yoyo\",\n \"tokenApiAuthentication\": \"header\",\n \"type\": \"oauth-client\"\n },\n \"persistCookies\": true\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 \"httpVersion\": \"http2\"\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/tests/v1/features/synthetics.feature b/tests/v1/features/synthetics.feature index 07bd1a5147..91a2abe7ee 100644 --- a/tests/v1/features/synthetics.feature +++ b/tests/v1/features/synthetics.feature @@ -132,6 +132,16 @@ Feature: Synthetics 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 HTTP test has bodyHash filled out + 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 "config.assertions[5].operator" is equal to "md5" + And the response "config.assertions[5].target" is equal to "a" + And the response "config.assertions[5].type" is equal to "bodyHash" + @team:DataDog/synthetics-app Scenario: Create an API HTTP test returns "OK - Returns the created test details." response Given new "CreateSyntheticsAPITest" request diff --git a/tests/v1/features/synthetics_api_http_test_payload.json b/tests/v1/features/synthetics_api_http_test_payload.json index e7ec61df3b..7248594a60 100644 --- a/tests/v1/features/synthetics_api_http_test_payload.json +++ b/tests/v1/features/synthetics_api_http_test_payload.json @@ -33,6 +33,11 @@ "operator": "contains" }, "type": "body" + }, + { + "operator": "md5", + "target": "a", + "type": "bodyHash" } ], "configVariables": [