From b9e2b1c7773d37498427452a402e83aed403ad19 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 4 Feb 2026 10:47:17 +0000 Subject: [PATCH] Regenerate client from commit 08e4d56 of spec repo --- .generator/schemas/v1/openapi.yaml | 19 +- .generator/schemas/v2/openapi.yaml | 780 +++++++++++++++++- docs/datadog_api_client.v2.model.rst | 259 ++++++ .../synthetics/CreateSyntheticsNetworkTest.py | 68 ++ .../v2/synthetics/DeleteSyntheticsTests.py | 28 + .../v2/synthetics/GetSyntheticsNetworkTest.py | 15 + .../synthetics/UpdateSyntheticsNetworkTest.py | 98 +++ .../v1/api/synthetics_api.py | 13 +- .../v2/api/synthetics_api.py | 171 +++- .../v2/model/deleted_test_response_data.py | 64 ++ .../deleted_test_response_data_attributes.py | 43 + .../v2/model/deleted_tests_request_delete.py | 66 ++ ...deleted_tests_request_delete_attributes.py | 43 + .../deleted_tests_request_delete_request.py | 40 + .../v2/model/deleted_tests_request_type.py | 35 + .../v2/model/deleted_tests_response.py | 42 + .../v2/model/deleted_tests_response_type.py | 35 + .../v2/model/synthetics_network_assertion.py | 57 ++ .../synthetics_network_assertion_jitter.py | 64 ++ ...ynthetics_network_assertion_jitter_type.py | 35 + .../synthetics_network_assertion_latency.py | 73 ++ ...nthetics_network_assertion_latency_type.py | 35 + ...ics_network_assertion_multi_network_hop.py | 73 ++ ...etwork_assertion_multi_network_hop_type.py | 37 + .../synthetics_network_assertion_operator.py | 50 ++ ...etwork_assertion_packet_loss_percentage.py | 71 ++ ...k_assertion_packet_loss_percentage_type.py | 37 + .../synthetics_network_assertion_property.py | 41 + .../v2/model/synthetics_network_test.py | 135 +++ .../model/synthetics_network_test_config.py | 75 ++ .../v2/model/synthetics_network_test_edit.py | 48 ++ .../synthetics_network_test_edit_request.py | 40 + .../model/synthetics_network_test_request.py | 112 +++ ...thetics_network_test_request_tcp_method.py | 41 + .../model/synthetics_network_test_response.py | 42 + .../synthetics_network_test_response_data.py | 67 ++ .../synthetics_network_test_response_type.py | 35 + .../model/synthetics_network_test_sub_type.py | 41 + .../v2/model/synthetics_network_test_type.py | 35 + .../v2/model/synthetics_test_options.py | 129 +++ ...synthetics_test_options_monitor_options.py | 82 ++ ...onitor_options_notification_preset_name.py | 67 ++ .../v2/model/synthetics_test_options_retry.py | 45 + .../synthetics_test_options_scheduling.py | 50 ++ ...etics_test_options_scheduling_timeframe.py | 52 ++ .../v2/model/synthetics_test_pause_status.py | 39 + src/datadog_api_client/v2/models/__init__.py | 86 ++ tests/v1/features/synthetics.feature | 18 +- ...twork_path_test_returns_ok_response.frozen | 1 + ...network_path_test_returns_ok_response.yaml | 45 + ...twork_path_test_returns_ok_response.frozen | 1 + ...network_path_test_returns_ok_response.yaml | 21 + tests/v2/features/synthetics.feature | 77 +- tests/v2/features/undo.json | 31 + 54 files changed, 3766 insertions(+), 41 deletions(-) create mode 100644 examples/v2/synthetics/CreateSyntheticsNetworkTest.py create mode 100644 examples/v2/synthetics/DeleteSyntheticsTests.py create mode 100644 examples/v2/synthetics/GetSyntheticsNetworkTest.py create mode 100644 examples/v2/synthetics/UpdateSyntheticsNetworkTest.py create mode 100644 src/datadog_api_client/v2/model/deleted_test_response_data.py create mode 100644 src/datadog_api_client/v2/model/deleted_test_response_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/deleted_tests_request_delete.py create mode 100644 src/datadog_api_client/v2/model/deleted_tests_request_delete_attributes.py create mode 100644 src/datadog_api_client/v2/model/deleted_tests_request_delete_request.py create mode 100644 src/datadog_api_client/v2/model/deleted_tests_request_type.py create mode 100644 src/datadog_api_client/v2/model/deleted_tests_response.py create mode 100644 src/datadog_api_client/v2/model/deleted_tests_response_type.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_jitter.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_jitter_type.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_latency.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_latency_type.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_multi_network_hop.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_multi_network_hop_type.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_operator.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_packet_loss_percentage.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_packet_loss_percentage_type.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_assertion_property.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_config.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_edit.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_edit_request.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_request.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_request_tcp_method.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_response.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_response_data.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_response_type.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_sub_type.py create mode 100644 src/datadog_api_client/v2/model/synthetics_network_test_type.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_options.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_options_monitor_options.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_options_monitor_options_notification_preset_name.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_options_retry.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_options_scheduling.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_options_scheduling_timeframe.py create mode 100644 src/datadog_api_client/v2/model/synthetics_test_pause_status.py create mode 100644 tests/v2/cassettes/test_scenarios/test_synthetics_create_a_network_path_test_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_synthetics_create_a_network_path_test_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_synthetics_get_a_network_path_test_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_synthetics_get_a_network_path_test_returns_ok_response.yaml diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index a38d274f9b..776f8d34fb 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -39463,18 +39463,21 @@ tags: name: Slack Integration - description: Take graph snapshots using the API. name: Snapshots -- description: 'Datadog Synthetic Monitoring uses simulated user requests and browser - rendering to help you ensure uptime, +- description: 'Synthetic tests use simulated requests and actions so you can monitor + the availability and performance of systems and applications. Datadog supports + the following types of synthetic tests: - identify regional issues, and track your application performance. Synthetic tests - come in + - [API tests](https://docs.datadoghq.com/synthetics/api_tests/) - two different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest) + - [Browser tests](https://docs.datadoghq.com/synthetics/browser_tests) - and [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You - can use Datadog''s API to + - [Network Path tests](https://docs.datadoghq.com/synthetics/network_path_tests/) - manage both test types programmatically. + - [Mobile Application tests](https://docs.datadoghq.com/synthetics/mobile_app_testing) + + + You can use the Datadog API to create, manage, and organize tests and test suites + programmatically. For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/).' diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a8908359f4..094a9e5245 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -19296,6 +19296,78 @@ components: $ref: '#/components/schemas/DeletedSuiteResponseData' type: array type: object + DeletedTestResponseData: + properties: + attributes: + $ref: '#/components/schemas/DeletedTestResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/DeletedTestsResponseType' + type: object + DeletedTestResponseDataAttributes: + properties: + deleted_at: + description: Deletion timestamp of the Synthetic test ID. + type: string + public_id: + description: The Synthetic test ID deleted. + type: string + type: object + DeletedTestsRequestDelete: + properties: + attributes: + $ref: '#/components/schemas/DeletedTestsRequestDeleteAttributes' + id: + type: string + type: + $ref: '#/components/schemas/DeletedTestsRequestType' + required: + - attributes + type: object + DeletedTestsRequestDeleteAttributes: + properties: + force_delete_dependencies: + type: boolean + public_ids: + example: + - '' + items: + type: string + type: array + required: + - public_ids + type: object + DeletedTestsRequestDeleteRequest: + properties: + data: + $ref: '#/components/schemas/DeletedTestsRequestDelete' + required: + - data + type: object + DeletedTestsRequestType: + default: delete_tests_request + enum: + - delete_tests_request + example: delete_tests_request + type: string + x-enum-varnames: + - DELETE_TESTS_REQUEST + DeletedTestsResponse: + properties: + data: + items: + $ref: '#/components/schemas/DeletedTestResponseData' + type: array + type: object + DeletedTestsResponseType: + default: delete_tests + enum: + - delete_tests + example: delete_tests + type: string + x-enum-varnames: + - DELETE_TESTS DependencyLocation: description: Static library vulnerability location. properties: @@ -60862,6 +60934,361 @@ components: example: example-value type: string type: object + SyntheticsNetworkAssertion: + description: Object describing an assertion for a Network Path test. + oneOf: + - $ref: '#/components/schemas/SyntheticsNetworkAssertionLatency' + - $ref: '#/components/schemas/SyntheticsNetworkAssertionMultiNetworkHop' + - $ref: '#/components/schemas/SyntheticsNetworkAssertionPacketLossPercentage' + - $ref: '#/components/schemas/SyntheticsNetworkAssertionJitter' + SyntheticsNetworkAssertionJitter: + description: Jitter assertion for a Network Path test. + properties: + operator: + $ref: '#/components/schemas/SyntheticsNetworkAssertionOperator' + target: + description: Target value in milliseconds. + example: 5 + format: double + type: number + type: + $ref: '#/components/schemas/SyntheticsNetworkAssertionJitterType' + required: + - operator + - target + - type + type: object + SyntheticsNetworkAssertionJitterType: + default: jitter + description: Type of the jitter assertion. + enum: + - jitter + example: jitter + type: string + x-enum-varnames: + - JITTER + SyntheticsNetworkAssertionLatency: + description: Network latency assertion for a Network Path test. + properties: + operator: + $ref: '#/components/schemas/SyntheticsNetworkAssertionOperator' + property: + $ref: '#/components/schemas/SyntheticsNetworkAssertionProperty' + target: + description: Target value in milliseconds. + example: 500 + format: double + type: number + type: + $ref: '#/components/schemas/SyntheticsNetworkAssertionLatencyType' + required: + - operator + - property + - target + - type + type: object + SyntheticsNetworkAssertionLatencyType: + default: latency + description: Type of the latency assertion. + enum: + - latency + example: latency + type: string + x-enum-varnames: + - LATENCY + SyntheticsNetworkAssertionMultiNetworkHop: + description: Multi-network hop assertion for a Network Path test. + properties: + operator: + $ref: '#/components/schemas/SyntheticsNetworkAssertionOperator' + property: + $ref: '#/components/schemas/SyntheticsNetworkAssertionProperty' + target: + description: Target value in number of hops. + example: 3 + format: double + type: number + type: + $ref: '#/components/schemas/SyntheticsNetworkAssertionMultiNetworkHopType' + required: + - operator + - property + - target + - type + type: object + SyntheticsNetworkAssertionMultiNetworkHopType: + default: multiNetworkHop + description: Type of the multi-network hop assertion. + enum: + - multiNetworkHop + example: multiNetworkHop + type: string + x-enum-varnames: + - MULTI_NETWORK_HOP + SyntheticsNetworkAssertionOperator: + description: Assertion operator to apply. + enum: + - is + - isNot + - lessThan + - lessThanOrEqual + - moreThan + - moreThanOrEqual + example: lessThan + type: string + x-enum-varnames: + - IS + - IS_NOT + - LESS_THAN + - LESS_THAN_OR_EQUAL + - MORE_THAN + - MORE_THAN_OR_EQUAL + SyntheticsNetworkAssertionPacketLossPercentage: + description: Packet loss percentage assertion for a Network Path test. + properties: + operator: + $ref: '#/components/schemas/SyntheticsNetworkAssertionOperator' + target: + description: Target value as a percentage (0 to 1). + example: 0.05 + format: double + maximum: 1 + minimum: 0 + type: number + type: + $ref: '#/components/schemas/SyntheticsNetworkAssertionPacketLossPercentageType' + required: + - operator + - target + - type + type: object + SyntheticsNetworkAssertionPacketLossPercentageType: + default: packetLossPercentage + description: Type of the packet loss percentage assertion. + enum: + - packetLossPercentage + example: packetLossPercentage + type: string + x-enum-varnames: + - PACKET_LOSS_PERCENTAGE + SyntheticsNetworkAssertionProperty: + description: The associated assertion property. + enum: + - avg + - max + - min + example: avg + type: string + x-enum-varnames: + - AVG + - MAX + - MIN + SyntheticsNetworkTest: + description: Object containing details about a Network Path test. + properties: + config: + $ref: '#/components/schemas/SyntheticsNetworkTestConfig' + locations: + description: 'Array of locations used to run the test. Network Path tests + can be run from managed locations to test public endpoints, + + or from a [Datadog Agent](https://docs.datadoghq.com/synthetics/network_path_tests/#agent-configuration) + to test private environments.' + example: + - aws:us-east-1 + - agent:my-agent-name + items: + description: A location to run the test from. + type: string + type: array + message: + description: Notification message associated with the test. + example: Network Path test notification + type: string + monitor_id: + description: The associated monitor ID. + example: 12345678 + format: int64 + readOnly: true + type: integer + name: + description: Name of the test. + example: Example Network Path test + type: string + options: + $ref: '#/components/schemas/SyntheticsTestOptions' + public_id: + description: The public ID for the test. + example: abc-def-123 + readOnly: true + type: string + status: + $ref: '#/components/schemas/SyntheticsTestPauseStatus' + subtype: + $ref: '#/components/schemas/SyntheticsNetworkTestSubType' + tags: + description: Array of tags attached to the test. + example: + - env:production + items: + description: A tag attached to the test. + type: string + type: array + type: + $ref: '#/components/schemas/SyntheticsNetworkTestType' + required: + - name + - config + - locations + - options + - type + - message + type: object + SyntheticsNetworkTestConfig: + description: Configuration object for a Network Path test. + properties: + assertions: + default: [] + description: Array of assertions used for the test. + example: + - operator: lessThan + property: avg + target: 500 + type: latency + items: + $ref: '#/components/schemas/SyntheticsNetworkAssertion' + type: array + request: + $ref: '#/components/schemas/SyntheticsNetworkTestRequest' + type: object + SyntheticsNetworkTestEdit: + properties: + attributes: + $ref: '#/components/schemas/SyntheticsNetworkTest' + type: + $ref: '#/components/schemas/SyntheticsNetworkTestType' + required: + - attributes + - type + type: object + SyntheticsNetworkTestEditRequest: + description: Network Path test request. + properties: + data: + $ref: '#/components/schemas/SyntheticsNetworkTestEdit' + required: + - data + type: object + SyntheticsNetworkTestRequest: + description: Object describing the request for a Network Path test. + properties: + destination_service: + description: Destination service name. + type: string + e2e_queries: + description: Number of end-to-end queries. + example: 50 + format: int64 + type: integer + host: + description: Host name to query. + example: '' + type: string + max_ttl: + description: Maximum TTL for network packets. + example: 30 + format: int64 + type: integer + port: + description: 'For TCP or UDP tests, the port to use when performing the + test. + + If not set on a UDP test, a random port is assigned, which may affect + the results.' + example: 443 + format: int64 + type: integer + source_service: + description: Source service name. + type: string + tcp_method: + $ref: '#/components/schemas/SyntheticsNetworkTestRequestTCPMethod' + timeout: + description: Timeout in seconds. + format: int64 + type: integer + traceroute_queries: + description: Number of traceroute queries. + example: 3 + format: int64 + type: integer + required: + - host + - max_ttl + - e2e_queries + - traceroute_queries + type: object + SyntheticsNetworkTestRequestTCPMethod: + description: For TCP tests, the TCP method to use. + enum: + - prefer_sack + - syn + - sack + example: prefer_sack + type: string + x-enum-varnames: + - PREFER_SACK + - SYN + - SACK + SyntheticsNetworkTestResponse: + description: Network Path test response. + properties: + data: + $ref: '#/components/schemas/SyntheticsNetworkTestResponseData' + type: object + SyntheticsNetworkTestResponseData: + description: Network Path test response data. + properties: + attributes: + $ref: '#/components/schemas/SyntheticsNetworkTest' + id: + description: The public ID of the Network Path test. + example: abc-def-123 + readOnly: true + type: string + type: + $ref: '#/components/schemas/SyntheticsNetworkTestResponseType' + type: object + SyntheticsNetworkTestResponseType: + default: network_test + description: Type of response, `network_test`. + enum: + - network_test + example: network_test + type: string + x-enum-varnames: + - NETWORK_TEST + SyntheticsNetworkTestSubType: + description: 'Subtype of the Synthetic Network Path test: `tcp`, `udp`, or `icmp`.' + enum: + - tcp + - udp + - icmp + example: tcp + type: string + x-enum-varnames: + - TCP + - UDP + - ICMP + SyntheticsNetworkTestType: + default: network + description: Type of the Synthetic test, `network`. + enum: + - network + example: network + type: string + x-enum-varnames: + - NETWORK SyntheticsRestrictedRoles: deprecated: true description: A list of role identifiers that can be pulled from the Roles API, @@ -61017,6 +61444,163 @@ components: type: string x-enum-varnames: - SUITES + SyntheticsTestOptions: + description: Object describing the extra options for a Synthetic test. + properties: + min_failure_duration: + description: Minimum amount of time in failure required to trigger an alert. + format: int64 + type: integer + min_location_failed: + description: 'Minimum number of locations in failure required to trigger + + an alert.' + format: int64 + type: integer + monitor_name: + description: The monitor name is used for the alert title as well as for + all monitor dashboard widgets and SLOs. + type: string + monitor_options: + $ref: '#/components/schemas/SyntheticsTestOptionsMonitorOptions' + monitor_priority: + description: Integer from 1 (high) to 5 (low) indicating alert severity. + format: int32 + maximum: 5 + minimum: 1 + type: integer + restricted_roles: + $ref: '#/components/schemas/SyntheticsRestrictedRoles' + retry: + $ref: '#/components/schemas/SyntheticsTestOptionsRetry' + scheduling: + $ref: '#/components/schemas/SyntheticsTestOptionsScheduling' + tick_every: + description: The frequency at which to run the Synthetic test (in seconds). + format: int64 + maximum: 604800 + minimum: 30 + type: integer + type: object + SyntheticsTestOptionsMonitorOptions: + description: 'Object containing the options for a Synthetic test as a monitor + + (for example, renotification).' + properties: + escalation_message: + description: Message to include in the escalation notification. + type: string + notification_preset_name: + $ref: '#/components/schemas/SyntheticsTestOptionsMonitorOptionsNotificationPresetName' + renotify_interval: + description: 'Time interval before renotifying if the test is still failing + + (in minutes).' + format: int64 + minimum: 0 + type: integer + renotify_occurrences: + description: The number of times to renotify if the test is still failing. + format: int64 + type: integer + type: object + SyntheticsTestOptionsMonitorOptionsNotificationPresetName: + description: The name of the preset for the notification for the monitor. + enum: + - show_all + - hide_all + - hide_query + - hide_handles + - hide_query_and_handles + - show_only_snapshot + - hide_handles_and_footer + type: string + x-enum-varnames: + - SHOW_ALL + - HIDE_ALL + - HIDE_QUERY + - HIDE_HANDLES + - HIDE_QUERY_AND_HANDLES + - SHOW_ONLY_SNAPSHOT + - HIDE_HANDLES_AND_FOOTER + SyntheticsTestOptionsRetry: + description: Object describing the retry strategy to apply to a Synthetic test. + properties: + count: + description: 'Number of times a test needs to be retried before marking + a + + location as failed. Defaults to 0.' + format: int64 + type: integer + interval: + description: 'Time interval between retries (in milliseconds). Defaults + to + + 300ms.' + format: double + type: number + type: object + SyntheticsTestOptionsScheduling: + description: Object containing timeframes and timezone used for advanced scheduling. + properties: + timeframes: + description: Array containing objects describing the scheduling pattern + to apply to each day. + example: + - day: 1 + from: 07:00 + to: '16:00' + - day: 3 + from: 07:00 + to: '16:00' + items: + $ref: '#/components/schemas/SyntheticsTestOptionsSchedulingTimeframe' + type: array + timezone: + description: Timezone in which the timeframe is based. + example: America/New_York + type: string + required: + - timeframes + - timezone + type: object + SyntheticsTestOptionsSchedulingTimeframe: + description: Object describing a timeframe. + properties: + day: + description: Number representing the day of the week. + example: 1 + format: int32 + maximum: 7 + minimum: 1 + type: integer + from: + description: The hour of the day on which scheduling starts. + example: 07:00 + type: string + to: + description: The hour of the day on which scheduling ends. + example: '16:00' + type: string + required: + - day + - from + - to + type: object + SyntheticsTestPauseStatus: + description: 'Define whether you want to start (`live`) or pause (`paused`) + a + + Synthetic test.' + enum: + - live + - paused + example: live + type: string + x-enum-varnames: + - LIVE + - PAUSED SyntheticsVariableParser: description: Details of the parser to use for the global variable. example: @@ -98582,6 +99166,178 @@ paths: operator: OR permissions: - synthetics_write + /api/v2/synthetics/tests/bulk-delete: + post: + operationId: DeleteSyntheticsTests + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedTestsRequestDeleteRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedTestsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: Bulk delete tests' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + /api/v2/synthetics/tests/network: + post: + operationId: CreateSyntheticsNetworkTest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestEditRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: Create a Network Path test' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger + /api/v2/synthetics/tests/network/{public_id}: + get: + operationId: GetSyntheticsNetworkTest + parameters: + - description: The public ID of the Network Path test to get details from. + in: path + name: public_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: 'Synthetics: Get a Network Path test' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + put: + operationId: UpdateSyntheticsNetworkTest + parameters: + - description: The public ID of the Network Path test to edit. + in: path + name: public_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestEditRequest' + description: New Network Path test details to be saved. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: Edit a Network Path test' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger /api/v2/synthetics/variables/{variable_id}/jsonpatch: patch: description: 'Patch a global variable using JSON Patch (RFC 6902). @@ -102879,12 +103635,24 @@ tags: via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information. name: Status Pages -- description: "Datadog Synthetics uses simulated user requests and browser rendering - to help you ensure uptime,\nidentify regional issues, and track your application - performance. Datadog Synthetics tests come in\ntwo different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/)\nand - [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You can - use Datadog\u2019s API to\nmanage both test types programmatically.\n\nFor more - information about Synthetics, see the [Synthetics overview](https://docs.datadoghq.com/synthetics/)." +- description: 'Synthetic tests use simulated requests and actions so you can monitor + the availability and performance of systems and applications. Datadog supports + the following types of synthetic tests: + + - [API tests](https://docs.datadoghq.com/synthetics/api_tests/) + + - [Browser tests](https://docs.datadoghq.com/synthetics/browser_tests) + + - [Network Path tests](https://docs.datadoghq.com/synthetics/network_path_tests/) + + - [Mobile Application tests](https://docs.datadoghq.com/synthetics/mobile_app_testing) + + + You can use the Datadog API to create, manage, and organize tests and test suites + programmatically. + + + For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/).' name: Synthetics - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index fe0c2aa3ef..c6f9ebb0d7 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -7641,6 +7641,62 @@ datadog\_api\_client.v2.model.deleted\_suites\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.deleted\_test\_response\_data module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.deleted_test_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deleted\_test\_response\_data\_attributes module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.deleted_test_response_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deleted\_tests\_request\_delete module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deleted_tests_request_delete + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deleted\_tests\_request\_delete\_attributes module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deleted_tests_request_delete_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deleted\_tests\_request\_delete\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deleted_tests_request_delete_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deleted\_tests\_request\_type module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.deleted_tests_request_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deleted\_tests\_response module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deleted_tests_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.deleted\_tests\_response\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.deleted_tests_response_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.dependency\_location module --------------------------------------------------------- @@ -26744,6 +26800,160 @@ datadog\_api\_client.v2.model.synthetics\_global\_variable\_value module :members: :show-inheritance: +datadog\_api\_client.v2.model.synthetics\_network\_assertion module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_jitter module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_jitter + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_jitter\_type module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_jitter_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_latency module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_latency + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_latency\_type module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_latency_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_multi\_network\_hop module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_multi_network_hop + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_multi\_network\_hop\_type module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_multi_network_hop_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_operator module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_operator + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_packet\_loss\_percentage module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_packet_loss_percentage + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_packet\_loss\_percentage\_type module +--------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_packet_loss_percentage_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_assertion\_property module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_assertion_property + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_config module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_config + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_edit module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_edit + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_edit\_request module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_edit_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_request module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_request\_tcp\_method module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_request_tcp_method + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_response module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_response\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_response\_type module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_response_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_sub\_type module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_sub_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_network\_test\_type module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_network_test_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.synthetics\_suite module ------------------------------------------------------ @@ -26821,6 +27031,55 @@ datadog\_api\_client.v2.model.synthetics\_suite\_types module :members: :show-inheritance: +datadog\_api\_client.v2.model.synthetics\_test\_options module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_options + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_options\_monitor\_options module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_options_monitor_options + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_options\_monitor\_options\_notification\_preset\_name module +------------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_test_options_monitor_options_notification_preset_name + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_options\_retry module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_options_retry + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_options\_scheduling module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_options_scheduling + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_options\_scheduling\_timeframe module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_options_scheduling_timeframe + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_test\_pause\_status module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_test_pause_status + :members: + :show-inheritance: + datadog\_api\_client.v2.model.synthetics\_variable\_parser module ----------------------------------------------------------------- diff --git a/examples/v2/synthetics/CreateSyntheticsNetworkTest.py b/examples/v2/synthetics/CreateSyntheticsNetworkTest.py new file mode 100644 index 0000000000..0d9a45ce2e --- /dev/null +++ b/examples/v2/synthetics/CreateSyntheticsNetworkTest.py @@ -0,0 +1,68 @@ +""" +Synthetics: Create a Network Path test returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.synthetics_network_assertion_latency import SyntheticsNetworkAssertionLatency +from datadog_api_client.v2.model.synthetics_network_assertion_latency_type import SyntheticsNetworkAssertionLatencyType +from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator +from datadog_api_client.v2.model.synthetics_network_assertion_property import SyntheticsNetworkAssertionProperty +from datadog_api_client.v2.model.synthetics_network_test import SyntheticsNetworkTest +from datadog_api_client.v2.model.synthetics_network_test_config import SyntheticsNetworkTestConfig +from datadog_api_client.v2.model.synthetics_network_test_edit import SyntheticsNetworkTestEdit +from datadog_api_client.v2.model.synthetics_network_test_edit_request import SyntheticsNetworkTestEditRequest +from datadog_api_client.v2.model.synthetics_network_test_request import SyntheticsNetworkTestRequest +from datadog_api_client.v2.model.synthetics_network_test_request_tcp_method import SyntheticsNetworkTestRequestTCPMethod +from datadog_api_client.v2.model.synthetics_network_test_sub_type import SyntheticsNetworkTestSubType +from datadog_api_client.v2.model.synthetics_network_test_type import SyntheticsNetworkTestType +from datadog_api_client.v2.model.synthetics_test_options import SyntheticsTestOptions +from datadog_api_client.v2.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + +body = SyntheticsNetworkTestEditRequest( + data=SyntheticsNetworkTestEdit( + attributes=SyntheticsNetworkTest( + config=SyntheticsNetworkTestConfig( + assertions=[ + SyntheticsNetworkAssertionLatency( + operator=SyntheticsNetworkAssertionOperator.LESS_THAN, + _property=SyntheticsNetworkAssertionProperty.AVG, + target=500.0, + type=SyntheticsNetworkAssertionLatencyType.LATENCY, + ), + ], + request=SyntheticsNetworkTestRequest( + host="example.com", + port=443, + tcp_method=SyntheticsNetworkTestRequestTCPMethod.PREFER_SACK, + max_ttl=30, + e2e_queries=50, + traceroute_queries=3, + ), + ), + locations=[ + "aws:us-east-1", + "agent:my-agent-name", + ], + message="Network Path test notification", + name="Example Network Path test", + options=SyntheticsTestOptions( + tick_every=60, + ), + status=SyntheticsTestPauseStatus.LIVE, + subtype=SyntheticsNetworkTestSubType.TCP, + tags=[ + "env:production", + ], + type=SyntheticsNetworkTestType.NETWORK, + ), + type=SyntheticsNetworkTestType.NETWORK, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.create_synthetics_network_test(body=body) + + print(response) diff --git a/examples/v2/synthetics/DeleteSyntheticsTests.py b/examples/v2/synthetics/DeleteSyntheticsTests.py new file mode 100644 index 0000000000..361cf3c932 --- /dev/null +++ b/examples/v2/synthetics/DeleteSyntheticsTests.py @@ -0,0 +1,28 @@ +""" +Synthetics: Bulk delete tests returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.deleted_tests_request_delete import DeletedTestsRequestDelete +from datadog_api_client.v2.model.deleted_tests_request_delete_attributes import DeletedTestsRequestDeleteAttributes +from datadog_api_client.v2.model.deleted_tests_request_delete_request import DeletedTestsRequestDeleteRequest +from datadog_api_client.v2.model.deleted_tests_request_type import DeletedTestsRequestType + +body = DeletedTestsRequestDeleteRequest( + data=DeletedTestsRequestDelete( + attributes=DeletedTestsRequestDeleteAttributes( + public_ids=[ + "", + ], + ), + type=DeletedTestsRequestType.DELETE_TESTS_REQUEST, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.delete_synthetics_tests(body=body) + + print(response) diff --git a/examples/v2/synthetics/GetSyntheticsNetworkTest.py b/examples/v2/synthetics/GetSyntheticsNetworkTest.py new file mode 100644 index 0000000000..933d23a72a --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsNetworkTest.py @@ -0,0 +1,15 @@ +""" +Synthetics: Get a Network Path test returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.get_synthetics_network_test( + public_id="amg-96x-tps", + ) + + print(response) diff --git a/examples/v2/synthetics/UpdateSyntheticsNetworkTest.py b/examples/v2/synthetics/UpdateSyntheticsNetworkTest.py new file mode 100644 index 0000000000..b6a5369e24 --- /dev/null +++ b/examples/v2/synthetics/UpdateSyntheticsNetworkTest.py @@ -0,0 +1,98 @@ +""" +Synthetics: Edit a Network Path test returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.synthetics_network_assertion_latency import SyntheticsNetworkAssertionLatency +from datadog_api_client.v2.model.synthetics_network_assertion_latency_type import SyntheticsNetworkAssertionLatencyType +from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator +from datadog_api_client.v2.model.synthetics_network_assertion_property import SyntheticsNetworkAssertionProperty +from datadog_api_client.v2.model.synthetics_network_test import SyntheticsNetworkTest +from datadog_api_client.v2.model.synthetics_network_test_config import SyntheticsNetworkTestConfig +from datadog_api_client.v2.model.synthetics_network_test_edit import SyntheticsNetworkTestEdit +from datadog_api_client.v2.model.synthetics_network_test_edit_request import SyntheticsNetworkTestEditRequest +from datadog_api_client.v2.model.synthetics_network_test_request import SyntheticsNetworkTestRequest +from datadog_api_client.v2.model.synthetics_network_test_request_tcp_method import SyntheticsNetworkTestRequestTCPMethod +from datadog_api_client.v2.model.synthetics_network_test_sub_type import SyntheticsNetworkTestSubType +from datadog_api_client.v2.model.synthetics_network_test_type import SyntheticsNetworkTestType +from datadog_api_client.v2.model.synthetics_test_options import SyntheticsTestOptions +from datadog_api_client.v2.model.synthetics_test_options_monitor_options import SyntheticsTestOptionsMonitorOptions +from datadog_api_client.v2.model.synthetics_test_options_monitor_options_notification_preset_name import ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName, +) +from datadog_api_client.v2.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry +from datadog_api_client.v2.model.synthetics_test_options_scheduling import SyntheticsTestOptionsScheduling +from datadog_api_client.v2.model.synthetics_test_options_scheduling_timeframe import ( + SyntheticsTestOptionsSchedulingTimeframe, +) +from datadog_api_client.v2.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + +body = SyntheticsNetworkTestEditRequest( + data=SyntheticsNetworkTestEdit( + attributes=SyntheticsNetworkTest( + config=SyntheticsNetworkTestConfig( + assertions=[ + SyntheticsNetworkAssertionLatency( + operator=SyntheticsNetworkAssertionOperator.LESS_THAN, + _property=SyntheticsNetworkAssertionProperty.AVG, + target=500.0, + type=SyntheticsNetworkAssertionLatencyType.LATENCY, + ), + ], + request=SyntheticsNetworkTestRequest( + e2e_queries=50, + host="", + max_ttl=30, + port=443, + tcp_method=SyntheticsNetworkTestRequestTCPMethod.PREFER_SACK, + traceroute_queries=3, + ), + ), + locations=[ + "aws:us-east-1", + "agent:my-agent-name", + ], + message="Network Path test notification", + name="Example Network Path test", + options=SyntheticsTestOptions( + monitor_options=SyntheticsTestOptionsMonitorOptions( + notification_preset_name=SyntheticsTestOptionsMonitorOptionsNotificationPresetName.SHOW_ALL, + ), + restricted_roles=[ + "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + ], + retry=SyntheticsTestOptionsRetry(), + scheduling=SyntheticsTestOptionsScheduling( + timeframes=[ + SyntheticsTestOptionsSchedulingTimeframe( + day=1, + _from="07:00", + to="16:00", + ), + SyntheticsTestOptionsSchedulingTimeframe( + day=3, + _from="07:00", + to="16:00", + ), + ], + timezone="America/New_York", + ), + ), + status=SyntheticsTestPauseStatus.LIVE, + subtype=SyntheticsNetworkTestSubType.TCP, + tags=[ + "env:production", + ], + type=SyntheticsNetworkTestType.NETWORK, + ), + type=SyntheticsNetworkTestType.NETWORK, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.update_synthetics_network_test(public_id="public_id", body=body) + + print(response) diff --git a/src/datadog_api_client/v1/api/synthetics_api.py b/src/datadog_api_client/v1/api/synthetics_api.py index 900dbbdd9e..eb9ce381be 100644 --- a/src/datadog_api_client/v1/api/synthetics_api.py +++ b/src/datadog_api_client/v1/api/synthetics_api.py @@ -52,11 +52,14 @@ class SyntheticsApi: """ - Datadog Synthetic Monitoring uses simulated user requests and browser rendering to help you ensure uptime, - identify regional issues, and track your application performance. Synthetic tests come in - two different flavors, `API tests `_ - and `browser tests `_. You can use Datadog's API to - manage both test types programmatically. + Synthetic tests use simulated requests and actions so you can monitor the availability and performance of systems and applications. Datadog supports the following types of synthetic tests: + + * `API tests `_ + * `Browser tests `_ + * `Network Path tests `_ + * `Mobile Application tests `_ + + You can use the Datadog API to create, manage, and organize tests and test suites programmatically. For more information, see the `Synthetic Monitoring documentation `_. """ diff --git a/src/datadog_api_client/v2/api/synthetics_api.py b/src/datadog_api_client/v2/api/synthetics_api.py index f9562aba63..7a717b32f6 100644 --- a/src/datadog_api_client/v2/api/synthetics_api.py +++ b/src/datadog_api_client/v2/api/synthetics_api.py @@ -18,19 +18,26 @@ from datadog_api_client.v2.model.deleted_suites_response import DeletedSuitesResponse from datadog_api_client.v2.model.deleted_suites_request_delete_request import DeletedSuitesRequestDeleteRequest from datadog_api_client.v2.model.synthetics_suite_search_response import SyntheticsSuiteSearchResponse +from datadog_api_client.v2.model.deleted_tests_response import DeletedTestsResponse +from datadog_api_client.v2.model.deleted_tests_request_delete_request import DeletedTestsRequestDeleteRequest +from datadog_api_client.v2.model.synthetics_network_test_response import SyntheticsNetworkTestResponse +from datadog_api_client.v2.model.synthetics_network_test_edit_request import SyntheticsNetworkTestEditRequest from datadog_api_client.v2.model.global_variable_response import GlobalVariableResponse from datadog_api_client.v2.model.global_variable_json_patch_request import GlobalVariableJsonPatchRequest class SyntheticsApi: """ - Datadog Synthetics uses simulated user requests and browser rendering to help you ensure uptime, - identify regional issues, and track your application performance. Datadog Synthetics tests come in - two different flavors, `API tests `_ - and `browser tests `_. You can use Datadog’s API to - manage both test types programmatically. + Synthetic tests use simulated requests and actions so you can monitor the availability and performance of systems and applications. Datadog supports the following types of synthetic tests: - For more information about Synthetics, see the `Synthetics overview `_. + * `API tests `_ + * `Browser tests `_ + * `Network Path tests `_ + * `Mobile Application tests `_ + + You can use the Datadog API to create, manage, and organize tests and test suites programmatically. + + For more information, see the `Synthetic Monitoring documentation `_. """ def __init__(self, api_client=None): @@ -38,6 +45,26 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_synthetics_network_test_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsNetworkTestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/synthetics/tests/network", + "operation_id": "create_synthetics_network_test", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (SyntheticsNetworkTestEditRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_synthetics_suite_endpoint = _Endpoint( settings={ "response_type": (SyntheticsSuiteResponse,), @@ -78,6 +105,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_synthetics_tests_endpoint = _Endpoint( + settings={ + "response_type": (DeletedTestsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/synthetics/tests/bulk-delete", + "operation_id": "delete_synthetics_tests", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (DeletedTestsRequestDeleteRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._edit_synthetics_suite_endpoint = _Endpoint( settings={ "response_type": (SyntheticsSuiteResponse,), @@ -120,6 +167,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_synthetics_network_test_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsNetworkTestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/synthetics/tests/network/{public_id}", + "operation_id": "get_synthetics_network_test", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "public_id": { + "required": True, + "openapi_types": (str,), + "attribute": "public_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_synthetics_suite_endpoint = _Endpoint( settings={ "response_type": (SyntheticsSuiteResponse,), @@ -231,6 +301,46 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_synthetics_network_test_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsNetworkTestResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/synthetics/tests/network/{public_id}", + "operation_id": "update_synthetics_network_test", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "public_id": { + "required": True, + "openapi_types": (str,), + "attribute": "public_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (SyntheticsNetworkTestEditRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_synthetics_network_test( + self, + body: SyntheticsNetworkTestEditRequest, + ) -> SyntheticsNetworkTestResponse: + """Synthetics: Create a Network Path test. + + :type body: SyntheticsNetworkTestEditRequest + :rtype: SyntheticsNetworkTestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_synthetics_network_test_endpoint.call_with_http_info(**kwargs) + def create_synthetics_suite( self, body: SuiteCreateEditRequest, @@ -259,6 +369,20 @@ def delete_synthetics_suites( return self._delete_synthetics_suites_endpoint.call_with_http_info(**kwargs) + def delete_synthetics_tests( + self, + body: DeletedTestsRequestDeleteRequest, + ) -> DeletedTestsResponse: + """Synthetics: Bulk delete tests. + + :type body: DeletedTestsRequestDeleteRequest + :rtype: DeletedTestsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._delete_synthetics_tests_endpoint.call_with_http_info(**kwargs) + def edit_synthetics_suite( self, public_id: str, @@ -291,6 +415,21 @@ def get_on_demand_concurrency_cap( kwargs: Dict[str, Any] = {} return self._get_on_demand_concurrency_cap_endpoint.call_with_http_info(**kwargs) + def get_synthetics_network_test( + self, + public_id: str, + ) -> SyntheticsNetworkTestResponse: + """Synthetics: Get a Network Path test. + + :param public_id: The public ID of the Network Path test to get details from. + :type public_id: str + :rtype: SyntheticsNetworkTestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["public_id"] = public_id + + return self._get_synthetics_network_test_endpoint.call_with_http_info(**kwargs) + def get_synthetics_suite( self, public_id: str, @@ -395,3 +534,23 @@ def set_on_demand_concurrency_cap( kwargs["body"] = body return self._set_on_demand_concurrency_cap_endpoint.call_with_http_info(**kwargs) + + def update_synthetics_network_test( + self, + public_id: str, + body: SyntheticsNetworkTestEditRequest, + ) -> SyntheticsNetworkTestResponse: + """Synthetics: Edit a Network Path test. + + :param public_id: The public ID of the Network Path test to edit. + :type public_id: str + :param body: New Network Path test details to be saved. + :type body: SyntheticsNetworkTestEditRequest + :rtype: SyntheticsNetworkTestResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["public_id"] = public_id + + kwargs["body"] = body + + return self._update_synthetics_network_test_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/deleted_test_response_data.py b/src/datadog_api_client/v2/model/deleted_test_response_data.py new file mode 100644 index 0000000000..f0e98b5aea --- /dev/null +++ b/src/datadog_api_client/v2/model/deleted_test_response_data.py @@ -0,0 +1,64 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.deleted_test_response_data_attributes import DeletedTestResponseDataAttributes + from datadog_api_client.v2.model.deleted_tests_response_type import DeletedTestsResponseType + + +class DeletedTestResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deleted_test_response_data_attributes import DeletedTestResponseDataAttributes + from datadog_api_client.v2.model.deleted_tests_response_type import DeletedTestsResponseType + + return { + "attributes": (DeletedTestResponseDataAttributes,), + "id": (str,), + "type": (DeletedTestsResponseType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[DeletedTestResponseDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[DeletedTestsResponseType, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: DeletedTestResponseDataAttributes, optional + + :param id: + :type id: str, optional + + :param type: + :type type: DeletedTestsResponseType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/deleted_test_response_data_attributes.py b/src/datadog_api_client/v2/model/deleted_test_response_data_attributes.py new file mode 100644 index 0000000000..18d8c71605 --- /dev/null +++ b/src/datadog_api_client/v2/model/deleted_test_response_data_attributes.py @@ -0,0 +1,43 @@ +# 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 Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class DeletedTestResponseDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "deleted_at": (str,), + "public_id": (str,), + } + + attribute_map = { + "deleted_at": "deleted_at", + "public_id": "public_id", + } + + def __init__(self_, deleted_at: Union[str, UnsetType] = unset, public_id: Union[str, UnsetType] = unset, **kwargs): + """ + + + :param deleted_at: Deletion timestamp of the Synthetic test ID. + :type deleted_at: str, optional + + :param public_id: The Synthetic test ID deleted. + :type public_id: str, optional + """ + if deleted_at is not unset: + kwargs["deleted_at"] = deleted_at + if public_id is not unset: + kwargs["public_id"] = public_id + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/deleted_tests_request_delete.py b/src/datadog_api_client/v2/model/deleted_tests_request_delete.py new file mode 100644 index 0000000000..2721b2e828 --- /dev/null +++ b/src/datadog_api_client/v2/model/deleted_tests_request_delete.py @@ -0,0 +1,66 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.deleted_tests_request_delete_attributes import DeletedTestsRequestDeleteAttributes + from datadog_api_client.v2.model.deleted_tests_request_type import DeletedTestsRequestType + + +class DeletedTestsRequestDelete(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deleted_tests_request_delete_attributes import ( + DeletedTestsRequestDeleteAttributes, + ) + from datadog_api_client.v2.model.deleted_tests_request_type import DeletedTestsRequestType + + return { + "attributes": (DeletedTestsRequestDeleteAttributes,), + "id": (str,), + "type": (DeletedTestsRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: DeletedTestsRequestDeleteAttributes, + id: Union[str, UnsetType] = unset, + type: Union[DeletedTestsRequestType, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: DeletedTestsRequestDeleteAttributes + + :param id: + :type id: str, optional + + :param type: + :type type: DeletedTestsRequestType, optional + """ + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) + + self_.attributes = attributes diff --git a/src/datadog_api_client/v2/model/deleted_tests_request_delete_attributes.py b/src/datadog_api_client/v2/model/deleted_tests_request_delete_attributes.py new file mode 100644 index 0000000000..b4403cdbbc --- /dev/null +++ b/src/datadog_api_client/v2/model/deleted_tests_request_delete_attributes.py @@ -0,0 +1,43 @@ +# 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 List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class DeletedTestsRequestDeleteAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "force_delete_dependencies": (bool,), + "public_ids": ([str],), + } + + attribute_map = { + "force_delete_dependencies": "force_delete_dependencies", + "public_ids": "public_ids", + } + + def __init__(self_, public_ids: List[str], force_delete_dependencies: Union[bool, UnsetType] = unset, **kwargs): + """ + + + :param force_delete_dependencies: + :type force_delete_dependencies: bool, optional + + :param public_ids: + :type public_ids: [str] + """ + if force_delete_dependencies is not unset: + kwargs["force_delete_dependencies"] = force_delete_dependencies + super().__init__(kwargs) + + self_.public_ids = public_ids diff --git a/src/datadog_api_client/v2/model/deleted_tests_request_delete_request.py b/src/datadog_api_client/v2/model/deleted_tests_request_delete_request.py new file mode 100644 index 0000000000..141be88e0c --- /dev/null +++ b/src/datadog_api_client/v2/model/deleted_tests_request_delete_request.py @@ -0,0 +1,40 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.deleted_tests_request_delete import DeletedTestsRequestDelete + + +class DeletedTestsRequestDeleteRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deleted_tests_request_delete import DeletedTestsRequestDelete + + return { + "data": (DeletedTestsRequestDelete,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: DeletedTestsRequestDelete, **kwargs): + """ + + + :param data: + :type data: DeletedTestsRequestDelete + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/deleted_tests_request_type.py b/src/datadog_api_client/v2/model/deleted_tests_request_type.py new file mode 100644 index 0000000000..985923552b --- /dev/null +++ b/src/datadog_api_client/v2/model/deleted_tests_request_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 DeletedTestsRequestType(ModelSimple): + """ + + + :param value: If omitted defaults to "delete_tests_request". Must be one of ["delete_tests_request"]. + :type value: str + """ + + allowed_values = { + "delete_tests_request", + } + DELETE_TESTS_REQUEST: ClassVar["DeletedTestsRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeletedTestsRequestType.DELETE_TESTS_REQUEST = DeletedTestsRequestType("delete_tests_request") diff --git a/src/datadog_api_client/v2/model/deleted_tests_response.py b/src/datadog_api_client/v2/model/deleted_tests_response.py new file mode 100644 index 0000000000..58c9af89ef --- /dev/null +++ b/src/datadog_api_client/v2/model/deleted_tests_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.deleted_test_response_data import DeletedTestResponseData + + +class DeletedTestsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.deleted_test_response_data import DeletedTestResponseData + + return { + "data": ([DeletedTestResponseData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[DeletedTestResponseData], UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: [DeletedTestResponseData], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/deleted_tests_response_type.py b/src/datadog_api_client/v2/model/deleted_tests_response_type.py new file mode 100644 index 0000000000..adca88dba8 --- /dev/null +++ b/src/datadog_api_client/v2/model/deleted_tests_response_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 DeletedTestsResponseType(ModelSimple): + """ + + + :param value: If omitted defaults to "delete_tests". Must be one of ["delete_tests"]. + :type value: str + """ + + allowed_values = { + "delete_tests", + } + DELETE_TESTS: ClassVar["DeletedTestsResponseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +DeletedTestsResponseType.DELETE_TESTS = DeletedTestsResponseType("delete_tests") diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion.py b/src/datadog_api_client/v2/model/synthetics_network_assertion.py new file mode 100644 index 0000000000..7348a87f57 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion.py @@ -0,0 +1,57 @@ +# 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 ( + ModelComposed, + cached_property, +) + + +class SyntheticsNetworkAssertion(ModelComposed): + def __init__(self, **kwargs): + """ + Object describing an assertion for a Network Path test. + + :param operator: Assertion operator to apply. + :type operator: SyntheticsNetworkAssertionOperator + + :param _property: The associated assertion property. + :type _property: SyntheticsNetworkAssertionProperty + + :param target: Target value in milliseconds. + :type target: float + + :param type: Type of the latency assertion. + :type type: SyntheticsNetworkAssertionLatencyType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.synthetics_network_assertion_latency import SyntheticsNetworkAssertionLatency + from datadog_api_client.v2.model.synthetics_network_assertion_multi_network_hop import ( + SyntheticsNetworkAssertionMultiNetworkHop, + ) + from datadog_api_client.v2.model.synthetics_network_assertion_packet_loss_percentage import ( + SyntheticsNetworkAssertionPacketLossPercentage, + ) + from datadog_api_client.v2.model.synthetics_network_assertion_jitter import SyntheticsNetworkAssertionJitter + + return { + "oneOf": [ + SyntheticsNetworkAssertionLatency, + SyntheticsNetworkAssertionMultiNetworkHop, + SyntheticsNetworkAssertionPacketLossPercentage, + SyntheticsNetworkAssertionJitter, + ], + } diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_jitter.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_jitter.py new file mode 100644 index 0000000000..74c1e7be88 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_jitter.py @@ -0,0 +1,64 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator + from datadog_api_client.v2.model.synthetics_network_assertion_jitter_type import ( + SyntheticsNetworkAssertionJitterType, + ) + + +class SyntheticsNetworkAssertionJitter(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator + from datadog_api_client.v2.model.synthetics_network_assertion_jitter_type import ( + SyntheticsNetworkAssertionJitterType, + ) + + return { + "operator": (SyntheticsNetworkAssertionOperator,), + "target": (float,), + "type": (SyntheticsNetworkAssertionJitterType,), + } + + attribute_map = { + "operator": "operator", + "target": "target", + "type": "type", + } + + def __init__( + self_, + operator: SyntheticsNetworkAssertionOperator, + target: float, + type: SyntheticsNetworkAssertionJitterType, + **kwargs, + ): + """ + Jitter assertion for a Network Path test. + + :param operator: Assertion operator to apply. + :type operator: SyntheticsNetworkAssertionOperator + + :param target: Target value in milliseconds. + :type target: float + + :param type: Type of the jitter assertion. + :type type: SyntheticsNetworkAssertionJitterType + """ + super().__init__(kwargs) + + self_.operator = operator + self_.target = target + self_.type = type diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_jitter_type.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_jitter_type.py new file mode 100644 index 0000000000..8c4815517f --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_jitter_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 SyntheticsNetworkAssertionJitterType(ModelSimple): + """ + Type of the jitter assertion. + + :param value: If omitted defaults to "jitter". Must be one of ["jitter"]. + :type value: str + """ + + allowed_values = { + "jitter", + } + JITTER: ClassVar["SyntheticsNetworkAssertionJitterType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkAssertionJitterType.JITTER = SyntheticsNetworkAssertionJitterType("jitter") diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_latency.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_latency.py new file mode 100644 index 0000000000..0b4e45efc6 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_latency.py @@ -0,0 +1,73 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator + from datadog_api_client.v2.model.synthetics_network_assertion_property import SyntheticsNetworkAssertionProperty + from datadog_api_client.v2.model.synthetics_network_assertion_latency_type import ( + SyntheticsNetworkAssertionLatencyType, + ) + + +class SyntheticsNetworkAssertionLatency(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator + from datadog_api_client.v2.model.synthetics_network_assertion_property import SyntheticsNetworkAssertionProperty + from datadog_api_client.v2.model.synthetics_network_assertion_latency_type import ( + SyntheticsNetworkAssertionLatencyType, + ) + + return { + "operator": (SyntheticsNetworkAssertionOperator,), + "_property": (SyntheticsNetworkAssertionProperty,), + "target": (float,), + "type": (SyntheticsNetworkAssertionLatencyType,), + } + + attribute_map = { + "operator": "operator", + "_property": "property", + "target": "target", + "type": "type", + } + + def __init__( + self_, + operator: SyntheticsNetworkAssertionOperator, + _property: SyntheticsNetworkAssertionProperty, + target: float, + type: SyntheticsNetworkAssertionLatencyType, + **kwargs, + ): + """ + Network latency assertion for a Network Path test. + + :param operator: Assertion operator to apply. + :type operator: SyntheticsNetworkAssertionOperator + + :param _property: The associated assertion property. + :type _property: SyntheticsNetworkAssertionProperty + + :param target: Target value in milliseconds. + :type target: float + + :param type: Type of the latency assertion. + :type type: SyntheticsNetworkAssertionLatencyType + """ + super().__init__(kwargs) + + self_.operator = operator + self_._property = _property + self_.target = target + self_.type = type diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_latency_type.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_latency_type.py new file mode 100644 index 0000000000..4cf7112736 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_latency_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 SyntheticsNetworkAssertionLatencyType(ModelSimple): + """ + Type of the latency assertion. + + :param value: If omitted defaults to "latency". Must be one of ["latency"]. + :type value: str + """ + + allowed_values = { + "latency", + } + LATENCY: ClassVar["SyntheticsNetworkAssertionLatencyType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkAssertionLatencyType.LATENCY = SyntheticsNetworkAssertionLatencyType("latency") diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_multi_network_hop.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_multi_network_hop.py new file mode 100644 index 0000000000..e23cff74e8 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_multi_network_hop.py @@ -0,0 +1,73 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator + from datadog_api_client.v2.model.synthetics_network_assertion_property import SyntheticsNetworkAssertionProperty + from datadog_api_client.v2.model.synthetics_network_assertion_multi_network_hop_type import ( + SyntheticsNetworkAssertionMultiNetworkHopType, + ) + + +class SyntheticsNetworkAssertionMultiNetworkHop(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator + from datadog_api_client.v2.model.synthetics_network_assertion_property import SyntheticsNetworkAssertionProperty + from datadog_api_client.v2.model.synthetics_network_assertion_multi_network_hop_type import ( + SyntheticsNetworkAssertionMultiNetworkHopType, + ) + + return { + "operator": (SyntheticsNetworkAssertionOperator,), + "_property": (SyntheticsNetworkAssertionProperty,), + "target": (float,), + "type": (SyntheticsNetworkAssertionMultiNetworkHopType,), + } + + attribute_map = { + "operator": "operator", + "_property": "property", + "target": "target", + "type": "type", + } + + def __init__( + self_, + operator: SyntheticsNetworkAssertionOperator, + _property: SyntheticsNetworkAssertionProperty, + target: float, + type: SyntheticsNetworkAssertionMultiNetworkHopType, + **kwargs, + ): + """ + Multi-network hop assertion for a Network Path test. + + :param operator: Assertion operator to apply. + :type operator: SyntheticsNetworkAssertionOperator + + :param _property: The associated assertion property. + :type _property: SyntheticsNetworkAssertionProperty + + :param target: Target value in number of hops. + :type target: float + + :param type: Type of the multi-network hop assertion. + :type type: SyntheticsNetworkAssertionMultiNetworkHopType + """ + super().__init__(kwargs) + + self_.operator = operator + self_._property = _property + self_.target = target + self_.type = type diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_multi_network_hop_type.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_multi_network_hop_type.py new file mode 100644 index 0000000000..0b246b9a58 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_multi_network_hop_type.py @@ -0,0 +1,37 @@ +# 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 SyntheticsNetworkAssertionMultiNetworkHopType(ModelSimple): + """ + Type of the multi-network hop assertion. + + :param value: If omitted defaults to "multiNetworkHop". Must be one of ["multiNetworkHop"]. + :type value: str + """ + + allowed_values = { + "multiNetworkHop", + } + MULTI_NETWORK_HOP: ClassVar["SyntheticsNetworkAssertionMultiNetworkHopType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkAssertionMultiNetworkHopType.MULTI_NETWORK_HOP = SyntheticsNetworkAssertionMultiNetworkHopType( + "multiNetworkHop" +) diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_operator.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_operator.py new file mode 100644 index 0000000000..88d0af9371 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_operator.py @@ -0,0 +1,50 @@ +# 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 SyntheticsNetworkAssertionOperator(ModelSimple): + """ + Assertion operator to apply. + + :param value: Must be one of ["is", "isNot", "lessThan", "lessThanOrEqual", "moreThan", "moreThanOrEqual"]. + :type value: str + """ + + allowed_values = { + "is", + "isNot", + "lessThan", + "lessThanOrEqual", + "moreThan", + "moreThanOrEqual", + } + IS: ClassVar["SyntheticsNetworkAssertionOperator"] + IS_NOT: ClassVar["SyntheticsNetworkAssertionOperator"] + LESS_THAN: ClassVar["SyntheticsNetworkAssertionOperator"] + LESS_THAN_OR_EQUAL: ClassVar["SyntheticsNetworkAssertionOperator"] + MORE_THAN: ClassVar["SyntheticsNetworkAssertionOperator"] + MORE_THAN_OR_EQUAL: ClassVar["SyntheticsNetworkAssertionOperator"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkAssertionOperator.IS = SyntheticsNetworkAssertionOperator("is") +SyntheticsNetworkAssertionOperator.IS_NOT = SyntheticsNetworkAssertionOperator("isNot") +SyntheticsNetworkAssertionOperator.LESS_THAN = SyntheticsNetworkAssertionOperator("lessThan") +SyntheticsNetworkAssertionOperator.LESS_THAN_OR_EQUAL = SyntheticsNetworkAssertionOperator("lessThanOrEqual") +SyntheticsNetworkAssertionOperator.MORE_THAN = SyntheticsNetworkAssertionOperator("moreThan") +SyntheticsNetworkAssertionOperator.MORE_THAN_OR_EQUAL = SyntheticsNetworkAssertionOperator("moreThanOrEqual") diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_packet_loss_percentage.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_packet_loss_percentage.py new file mode 100644 index 0000000000..2958538bfe --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_packet_loss_percentage.py @@ -0,0 +1,71 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator + from datadog_api_client.v2.model.synthetics_network_assertion_packet_loss_percentage_type import ( + SyntheticsNetworkAssertionPacketLossPercentageType, + ) + + +class SyntheticsNetworkAssertionPacketLossPercentage(ModelNormal): + validations = { + "target": { + "inclusive_maximum": 1, + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator + from datadog_api_client.v2.model.synthetics_network_assertion_packet_loss_percentage_type import ( + SyntheticsNetworkAssertionPacketLossPercentageType, + ) + + return { + "operator": (SyntheticsNetworkAssertionOperator,), + "target": (float,), + "type": (SyntheticsNetworkAssertionPacketLossPercentageType,), + } + + attribute_map = { + "operator": "operator", + "target": "target", + "type": "type", + } + + def __init__( + self_, + operator: SyntheticsNetworkAssertionOperator, + target: float, + type: SyntheticsNetworkAssertionPacketLossPercentageType, + **kwargs, + ): + """ + Packet loss percentage assertion for a Network Path test. + + :param operator: Assertion operator to apply. + :type operator: SyntheticsNetworkAssertionOperator + + :param target: Target value as a percentage (0 to 1). + :type target: float + + :param type: Type of the packet loss percentage assertion. + :type type: SyntheticsNetworkAssertionPacketLossPercentageType + """ + super().__init__(kwargs) + + self_.operator = operator + self_.target = target + self_.type = type diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_packet_loss_percentage_type.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_packet_loss_percentage_type.py new file mode 100644 index 0000000000..829c6b4656 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_packet_loss_percentage_type.py @@ -0,0 +1,37 @@ +# 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 SyntheticsNetworkAssertionPacketLossPercentageType(ModelSimple): + """ + Type of the packet loss percentage assertion. + + :param value: If omitted defaults to "packetLossPercentage". Must be one of ["packetLossPercentage"]. + :type value: str + """ + + allowed_values = { + "packetLossPercentage", + } + PACKET_LOSS_PERCENTAGE: ClassVar["SyntheticsNetworkAssertionPacketLossPercentageType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkAssertionPacketLossPercentageType.PACKET_LOSS_PERCENTAGE = ( + SyntheticsNetworkAssertionPacketLossPercentageType("packetLossPercentage") +) diff --git a/src/datadog_api_client/v2/model/synthetics_network_assertion_property.py b/src/datadog_api_client/v2/model/synthetics_network_assertion_property.py new file mode 100644 index 0000000000..3406707fa7 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_assertion_property.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 SyntheticsNetworkAssertionProperty(ModelSimple): + """ + The associated assertion property. + + :param value: Must be one of ["avg", "max", "min"]. + :type value: str + """ + + allowed_values = { + "avg", + "max", + "min", + } + AVG: ClassVar["SyntheticsNetworkAssertionProperty"] + MAX: ClassVar["SyntheticsNetworkAssertionProperty"] + MIN: ClassVar["SyntheticsNetworkAssertionProperty"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkAssertionProperty.AVG = SyntheticsNetworkAssertionProperty("avg") +SyntheticsNetworkAssertionProperty.MAX = SyntheticsNetworkAssertionProperty("max") +SyntheticsNetworkAssertionProperty.MIN = SyntheticsNetworkAssertionProperty("min") diff --git a/src/datadog_api_client/v2/model/synthetics_network_test.py b/src/datadog_api_client/v2/model/synthetics_network_test.py new file mode 100644 index 0000000000..5af593c6a0 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test.py @@ -0,0 +1,135 @@ +# 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 List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_test_config import SyntheticsNetworkTestConfig + from datadog_api_client.v2.model.synthetics_test_options import SyntheticsTestOptions + from datadog_api_client.v2.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + from datadog_api_client.v2.model.synthetics_network_test_sub_type import SyntheticsNetworkTestSubType + from datadog_api_client.v2.model.synthetics_network_test_type import SyntheticsNetworkTestType + + +class SyntheticsNetworkTest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_test_config import SyntheticsNetworkTestConfig + from datadog_api_client.v2.model.synthetics_test_options import SyntheticsTestOptions + from datadog_api_client.v2.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + from datadog_api_client.v2.model.synthetics_network_test_sub_type import SyntheticsNetworkTestSubType + from datadog_api_client.v2.model.synthetics_network_test_type import SyntheticsNetworkTestType + + return { + "config": (SyntheticsNetworkTestConfig,), + "locations": ([str],), + "message": (str,), + "monitor_id": (int,), + "name": (str,), + "options": (SyntheticsTestOptions,), + "public_id": (str,), + "status": (SyntheticsTestPauseStatus,), + "subtype": (SyntheticsNetworkTestSubType,), + "tags": ([str],), + "type": (SyntheticsNetworkTestType,), + } + + attribute_map = { + "config": "config", + "locations": "locations", + "message": "message", + "monitor_id": "monitor_id", + "name": "name", + "options": "options", + "public_id": "public_id", + "status": "status", + "subtype": "subtype", + "tags": "tags", + "type": "type", + } + read_only_vars = { + "monitor_id", + "public_id", + } + + def __init__( + self_, + config: SyntheticsNetworkTestConfig, + locations: List[str], + message: str, + name: str, + options: SyntheticsTestOptions, + type: SyntheticsNetworkTestType, + monitor_id: Union[int, UnsetType] = unset, + public_id: Union[str, UnsetType] = unset, + status: Union[SyntheticsTestPauseStatus, UnsetType] = unset, + subtype: Union[SyntheticsNetworkTestSubType, UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Object containing details about a Network Path test. + + :param config: Configuration object for a Network Path test. + :type config: SyntheticsNetworkTestConfig + + :param locations: Array of locations used to run the test. Network Path tests can be run from managed locations to test public endpoints, + or from a `Datadog Agent `_ to test private environments. + :type locations: [str] + + :param message: Notification message associated with the test. + :type message: str + + :param monitor_id: The associated monitor ID. + :type monitor_id: int, optional + + :param name: Name of the test. + :type name: str + + :param options: Object describing the extra options for a Synthetic test. + :type options: SyntheticsTestOptions + + :param public_id: The public ID for the test. + :type public_id: str, optional + + :param status: Define whether you want to start ( ``live`` ) or pause ( ``paused`` ) a + Synthetic test. + :type status: SyntheticsTestPauseStatus, optional + + :param subtype: Subtype of the Synthetic Network Path test: ``tcp`` , ``udp`` , or ``icmp``. + :type subtype: SyntheticsNetworkTestSubType, optional + + :param tags: Array of tags attached to the test. + :type tags: [str], optional + + :param type: Type of the Synthetic test, ``network``. + :type type: SyntheticsNetworkTestType + """ + if monitor_id is not unset: + kwargs["monitor_id"] = monitor_id + if public_id is not unset: + kwargs["public_id"] = public_id + if status is not unset: + kwargs["status"] = status + if subtype is not unset: + kwargs["subtype"] = subtype + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.config = config + self_.locations = locations + self_.message = message + self_.name = name + self_.options = options + self_.type = type diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_config.py b/src/datadog_api_client/v2/model/synthetics_network_test_config.py new file mode 100644 index 0000000000..0de9a67b71 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_config.py @@ -0,0 +1,75 @@ +# 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 List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_assertion import SyntheticsNetworkAssertion + from datadog_api_client.v2.model.synthetics_network_test_request import SyntheticsNetworkTestRequest + from datadog_api_client.v2.model.synthetics_network_assertion_latency import SyntheticsNetworkAssertionLatency + from datadog_api_client.v2.model.synthetics_network_assertion_multi_network_hop import ( + SyntheticsNetworkAssertionMultiNetworkHop, + ) + from datadog_api_client.v2.model.synthetics_network_assertion_packet_loss_percentage import ( + SyntheticsNetworkAssertionPacketLossPercentage, + ) + from datadog_api_client.v2.model.synthetics_network_assertion_jitter import SyntheticsNetworkAssertionJitter + + +class SyntheticsNetworkTestConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_assertion import SyntheticsNetworkAssertion + from datadog_api_client.v2.model.synthetics_network_test_request import SyntheticsNetworkTestRequest + + return { + "assertions": ([SyntheticsNetworkAssertion],), + "request": (SyntheticsNetworkTestRequest,), + } + + attribute_map = { + "assertions": "assertions", + "request": "request", + } + + def __init__( + self_, + assertions: Union[ + List[ + Union[ + SyntheticsNetworkAssertion, + SyntheticsNetworkAssertionLatency, + SyntheticsNetworkAssertionMultiNetworkHop, + SyntheticsNetworkAssertionPacketLossPercentage, + SyntheticsNetworkAssertionJitter, + ] + ], + UnsetType, + ] = unset, + request: Union[SyntheticsNetworkTestRequest, UnsetType] = unset, + **kwargs, + ): + """ + Configuration object for a Network Path test. + + :param assertions: Array of assertions used for the test. + :type assertions: [SyntheticsNetworkAssertion], optional + + :param request: Object describing the request for a Network Path test. + :type request: SyntheticsNetworkTestRequest, optional + """ + if assertions is not unset: + kwargs["assertions"] = assertions + if request is not unset: + kwargs["request"] = request + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_edit.py b/src/datadog_api_client/v2/model/synthetics_network_test_edit.py new file mode 100644 index 0000000000..4966faacf2 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_edit.py @@ -0,0 +1,48 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_test import SyntheticsNetworkTest + from datadog_api_client.v2.model.synthetics_network_test_type import SyntheticsNetworkTestType + + +class SyntheticsNetworkTestEdit(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_test import SyntheticsNetworkTest + from datadog_api_client.v2.model.synthetics_network_test_type import SyntheticsNetworkTestType + + return { + "attributes": (SyntheticsNetworkTest,), + "type": (SyntheticsNetworkTestType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: SyntheticsNetworkTest, type: SyntheticsNetworkTestType, **kwargs): + """ + + + :param attributes: Object containing details about a Network Path test. + :type attributes: SyntheticsNetworkTest + + :param type: Type of the Synthetic test, ``network``. + :type type: SyntheticsNetworkTestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_edit_request.py b/src/datadog_api_client/v2/model/synthetics_network_test_edit_request.py new file mode 100644 index 0000000000..d035d1e4fe --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_edit_request.py @@ -0,0 +1,40 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_test_edit import SyntheticsNetworkTestEdit + + +class SyntheticsNetworkTestEditRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_test_edit import SyntheticsNetworkTestEdit + + return { + "data": (SyntheticsNetworkTestEdit,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SyntheticsNetworkTestEdit, **kwargs): + """ + Network Path test request. + + :param data: + :type data: SyntheticsNetworkTestEdit + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_request.py b/src/datadog_api_client/v2/model/synthetics_network_test_request.py new file mode 100644 index 0000000000..62faa96301 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_request.py @@ -0,0 +1,112 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_test_request_tcp_method import ( + SyntheticsNetworkTestRequestTCPMethod, + ) + + +class SyntheticsNetworkTestRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_test_request_tcp_method import ( + SyntheticsNetworkTestRequestTCPMethod, + ) + + return { + "destination_service": (str,), + "e2e_queries": (int,), + "host": (str,), + "max_ttl": (int,), + "port": (int,), + "source_service": (str,), + "tcp_method": (SyntheticsNetworkTestRequestTCPMethod,), + "timeout": (int,), + "traceroute_queries": (int,), + } + + attribute_map = { + "destination_service": "destination_service", + "e2e_queries": "e2e_queries", + "host": "host", + "max_ttl": "max_ttl", + "port": "port", + "source_service": "source_service", + "tcp_method": "tcp_method", + "timeout": "timeout", + "traceroute_queries": "traceroute_queries", + } + + def __init__( + self_, + e2e_queries: int, + host: str, + max_ttl: int, + traceroute_queries: int, + destination_service: Union[str, UnsetType] = unset, + port: Union[int, UnsetType] = unset, + source_service: Union[str, UnsetType] = unset, + tcp_method: Union[SyntheticsNetworkTestRequestTCPMethod, UnsetType] = unset, + timeout: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Object describing the request for a Network Path test. + + :param destination_service: Destination service name. + :type destination_service: str, optional + + :param e2e_queries: Number of end-to-end queries. + :type e2e_queries: int + + :param host: Host name to query. + :type host: str + + :param max_ttl: Maximum TTL for network packets. + :type max_ttl: int + + :param port: For TCP or UDP tests, the port to use when performing the test. + If not set on a UDP test, a random port is assigned, which may affect the results. + :type port: int, optional + + :param source_service: Source service name. + :type source_service: str, optional + + :param tcp_method: For TCP tests, the TCP method to use. + :type tcp_method: SyntheticsNetworkTestRequestTCPMethod, optional + + :param timeout: Timeout in seconds. + :type timeout: int, optional + + :param traceroute_queries: Number of traceroute queries. + :type traceroute_queries: int + """ + if destination_service is not unset: + kwargs["destination_service"] = destination_service + if port is not unset: + kwargs["port"] = port + if source_service is not unset: + kwargs["source_service"] = source_service + if tcp_method is not unset: + kwargs["tcp_method"] = tcp_method + if timeout is not unset: + kwargs["timeout"] = timeout + super().__init__(kwargs) + + self_.e2e_queries = e2e_queries + self_.host = host + self_.max_ttl = max_ttl + self_.traceroute_queries = traceroute_queries diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_request_tcp_method.py b/src/datadog_api_client/v2/model/synthetics_network_test_request_tcp_method.py new file mode 100644 index 0000000000..ce9f9e7fb8 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_request_tcp_method.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 SyntheticsNetworkTestRequestTCPMethod(ModelSimple): + """ + For TCP tests, the TCP method to use. + + :param value: Must be one of ["prefer_sack", "syn", "sack"]. + :type value: str + """ + + allowed_values = { + "prefer_sack", + "syn", + "sack", + } + PREFER_SACK: ClassVar["SyntheticsNetworkTestRequestTCPMethod"] + SYN: ClassVar["SyntheticsNetworkTestRequestTCPMethod"] + SACK: ClassVar["SyntheticsNetworkTestRequestTCPMethod"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkTestRequestTCPMethod.PREFER_SACK = SyntheticsNetworkTestRequestTCPMethod("prefer_sack") +SyntheticsNetworkTestRequestTCPMethod.SYN = SyntheticsNetworkTestRequestTCPMethod("syn") +SyntheticsNetworkTestRequestTCPMethod.SACK = SyntheticsNetworkTestRequestTCPMethod("sack") diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_response.py b/src/datadog_api_client/v2/model/synthetics_network_test_response.py new file mode 100644 index 0000000000..400fe5cbdc --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_test_response_data import SyntheticsNetworkTestResponseData + + +class SyntheticsNetworkTestResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_test_response_data import SyntheticsNetworkTestResponseData + + return { + "data": (SyntheticsNetworkTestResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[SyntheticsNetworkTestResponseData, UnsetType] = unset, **kwargs): + """ + Network Path test response. + + :param data: Network Path test response data. + :type data: SyntheticsNetworkTestResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_response_data.py b/src/datadog_api_client/v2/model/synthetics_network_test_response_data.py new file mode 100644 index 0000000000..598d026fa0 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_response_data.py @@ -0,0 +1,67 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_network_test import SyntheticsNetworkTest + from datadog_api_client.v2.model.synthetics_network_test_response_type import SyntheticsNetworkTestResponseType + + +class SyntheticsNetworkTestResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_network_test import SyntheticsNetworkTest + from datadog_api_client.v2.model.synthetics_network_test_response_type import SyntheticsNetworkTestResponseType + + return { + "attributes": (SyntheticsNetworkTest,), + "id": (str,), + "type": (SyntheticsNetworkTestResponseType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + read_only_vars = { + "id", + } + + def __init__( + self_, + attributes: Union[SyntheticsNetworkTest, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[SyntheticsNetworkTestResponseType, UnsetType] = unset, + **kwargs, + ): + """ + Network Path test response data. + + :param attributes: Object containing details about a Network Path test. + :type attributes: SyntheticsNetworkTest, optional + + :param id: The public ID of the Network Path test. + :type id: str, optional + + :param type: Type of response, ``network_test``. + :type type: SyntheticsNetworkTestResponseType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_response_type.py b/src/datadog_api_client/v2/model/synthetics_network_test_response_type.py new file mode 100644 index 0000000000..e22827a6b4 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_response_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 SyntheticsNetworkTestResponseType(ModelSimple): + """ + Type of response, `network_test`. + + :param value: If omitted defaults to "network_test". Must be one of ["network_test"]. + :type value: str + """ + + allowed_values = { + "network_test", + } + NETWORK_TEST: ClassVar["SyntheticsNetworkTestResponseType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkTestResponseType.NETWORK_TEST = SyntheticsNetworkTestResponseType("network_test") diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_sub_type.py b/src/datadog_api_client/v2/model/synthetics_network_test_sub_type.py new file mode 100644 index 0000000000..f603d0eb2c --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_sub_type.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 SyntheticsNetworkTestSubType(ModelSimple): + """ + Subtype of the Synthetic Network Path test: `tcp`, `udp`, or `icmp`. + + :param value: Must be one of ["tcp", "udp", "icmp"]. + :type value: str + """ + + allowed_values = { + "tcp", + "udp", + "icmp", + } + TCP: ClassVar["SyntheticsNetworkTestSubType"] + UDP: ClassVar["SyntheticsNetworkTestSubType"] + ICMP: ClassVar["SyntheticsNetworkTestSubType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkTestSubType.TCP = SyntheticsNetworkTestSubType("tcp") +SyntheticsNetworkTestSubType.UDP = SyntheticsNetworkTestSubType("udp") +SyntheticsNetworkTestSubType.ICMP = SyntheticsNetworkTestSubType("icmp") diff --git a/src/datadog_api_client/v2/model/synthetics_network_test_type.py b/src/datadog_api_client/v2/model/synthetics_network_test_type.py new file mode 100644 index 0000000000..add8f3a549 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_network_test_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 SyntheticsNetworkTestType(ModelSimple): + """ + Type of the Synthetic test, `network`. + + :param value: If omitted defaults to "network". Must be one of ["network"]. + :type value: str + """ + + allowed_values = { + "network", + } + NETWORK: ClassVar["SyntheticsNetworkTestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsNetworkTestType.NETWORK = SyntheticsNetworkTestType("network") diff --git a/src/datadog_api_client/v2/model/synthetics_test_options.py b/src/datadog_api_client/v2/model/synthetics_test_options.py new file mode 100644 index 0000000000..4a40783e92 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_options.py @@ -0,0 +1,129 @@ +# 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 List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_test_options_monitor_options import SyntheticsTestOptionsMonitorOptions + from datadog_api_client.v2.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry + from datadog_api_client.v2.model.synthetics_test_options_scheduling import SyntheticsTestOptionsScheduling + + +class SyntheticsTestOptions(ModelNormal): + validations = { + "monitor_priority": { + "inclusive_maximum": 5, + "inclusive_minimum": 1, + }, + "tick_every": { + "inclusive_maximum": 604800, + "inclusive_minimum": 30, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_test_options_monitor_options import ( + SyntheticsTestOptionsMonitorOptions, + ) + from datadog_api_client.v2.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry + from datadog_api_client.v2.model.synthetics_test_options_scheduling import SyntheticsTestOptionsScheduling + + return { + "min_failure_duration": (int,), + "min_location_failed": (int,), + "monitor_name": (str,), + "monitor_options": (SyntheticsTestOptionsMonitorOptions,), + "monitor_priority": (int,), + "restricted_roles": ([str],), + "retry": (SyntheticsTestOptionsRetry,), + "scheduling": (SyntheticsTestOptionsScheduling,), + "tick_every": (int,), + } + + attribute_map = { + "min_failure_duration": "min_failure_duration", + "min_location_failed": "min_location_failed", + "monitor_name": "monitor_name", + "monitor_options": "monitor_options", + "monitor_priority": "monitor_priority", + "restricted_roles": "restricted_roles", + "retry": "retry", + "scheduling": "scheduling", + "tick_every": "tick_every", + } + + def __init__( + self_, + min_failure_duration: Union[int, UnsetType] = unset, + min_location_failed: Union[int, UnsetType] = unset, + monitor_name: Union[str, UnsetType] = unset, + monitor_options: Union[SyntheticsTestOptionsMonitorOptions, UnsetType] = unset, + monitor_priority: Union[int, UnsetType] = unset, + restricted_roles: Union[List[str], UnsetType] = unset, + retry: Union[SyntheticsTestOptionsRetry, UnsetType] = unset, + scheduling: Union[SyntheticsTestOptionsScheduling, UnsetType] = unset, + tick_every: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Object describing the extra options for a Synthetic test. + + :param min_failure_duration: Minimum amount of time in failure required to trigger an alert. + :type min_failure_duration: int, optional + + :param min_location_failed: Minimum number of locations in failure required to trigger + an alert. + :type min_location_failed: int, optional + + :param monitor_name: The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs. + :type monitor_name: str, optional + + :param monitor_options: Object containing the options for a Synthetic test as a monitor + (for example, renotification). + :type monitor_options: SyntheticsTestOptionsMonitorOptions, optional + + :param monitor_priority: Integer from 1 (high) to 5 (low) indicating alert severity. + :type monitor_priority: int, optional + + :param restricted_roles: A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions. **Deprecated**. + :type restricted_roles: [str], optional + + :param retry: Object describing the retry strategy to apply to a Synthetic test. + :type retry: SyntheticsTestOptionsRetry, optional + + :param scheduling: Object containing timeframes and timezone used for advanced scheduling. + :type scheduling: SyntheticsTestOptionsScheduling, optional + + :param tick_every: The frequency at which to run the Synthetic test (in seconds). + :type tick_every: int, optional + """ + if min_failure_duration is not unset: + kwargs["min_failure_duration"] = min_failure_duration + if min_location_failed is not unset: + kwargs["min_location_failed"] = min_location_failed + if monitor_name is not unset: + kwargs["monitor_name"] = monitor_name + if monitor_options is not unset: + kwargs["monitor_options"] = monitor_options + if monitor_priority is not unset: + kwargs["monitor_priority"] = monitor_priority + if restricted_roles is not unset: + kwargs["restricted_roles"] = restricted_roles + if retry is not unset: + kwargs["retry"] = retry + if scheduling is not unset: + kwargs["scheduling"] = scheduling + if tick_every is not unset: + kwargs["tick_every"] = tick_every + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/synthetics_test_options_monitor_options.py b/src/datadog_api_client/v2/model/synthetics_test_options_monitor_options.py new file mode 100644 index 0000000000..221515900a --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_options_monitor_options.py @@ -0,0 +1,82 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_test_options_monitor_options_notification_preset_name import ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName, + ) + + +class SyntheticsTestOptionsMonitorOptions(ModelNormal): + validations = { + "renotify_interval": { + "inclusive_minimum": 0, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_test_options_monitor_options_notification_preset_name import ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName, + ) + + return { + "escalation_message": (str,), + "notification_preset_name": (SyntheticsTestOptionsMonitorOptionsNotificationPresetName,), + "renotify_interval": (int,), + "renotify_occurrences": (int,), + } + + attribute_map = { + "escalation_message": "escalation_message", + "notification_preset_name": "notification_preset_name", + "renotify_interval": "renotify_interval", + "renotify_occurrences": "renotify_occurrences", + } + + def __init__( + self_, + escalation_message: Union[str, UnsetType] = unset, + notification_preset_name: Union[SyntheticsTestOptionsMonitorOptionsNotificationPresetName, UnsetType] = unset, + renotify_interval: Union[int, UnsetType] = unset, + renotify_occurrences: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Object containing the options for a Synthetic test as a monitor + (for example, renotification). + + :param escalation_message: Message to include in the escalation notification. + :type escalation_message: str, optional + + :param notification_preset_name: The name of the preset for the notification for the monitor. + :type notification_preset_name: SyntheticsTestOptionsMonitorOptionsNotificationPresetName, optional + + :param renotify_interval: Time interval before renotifying if the test is still failing + (in minutes). + :type renotify_interval: int, optional + + :param renotify_occurrences: The number of times to renotify if the test is still failing. + :type renotify_occurrences: int, optional + """ + if escalation_message is not unset: + kwargs["escalation_message"] = escalation_message + if notification_preset_name is not unset: + kwargs["notification_preset_name"] = notification_preset_name + if renotify_interval is not unset: + kwargs["renotify_interval"] = renotify_interval + if renotify_occurrences is not unset: + kwargs["renotify_occurrences"] = renotify_occurrences + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/synthetics_test_options_monitor_options_notification_preset_name.py b/src/datadog_api_client/v2/model/synthetics_test_options_monitor_options_notification_preset_name.py new file mode 100644 index 0000000000..07d1517ba4 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_options_monitor_options_notification_preset_name.py @@ -0,0 +1,67 @@ +# 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 SyntheticsTestOptionsMonitorOptionsNotificationPresetName(ModelSimple): + """ + The name of the preset for the notification for the monitor. + + :param value: Must be one of ["show_all", "hide_all", "hide_query", "hide_handles", "hide_query_and_handles", "show_only_snapshot", "hide_handles_and_footer"]. + :type value: str + """ + + allowed_values = { + "show_all", + "hide_all", + "hide_query", + "hide_handles", + "hide_query_and_handles", + "show_only_snapshot", + "hide_handles_and_footer", + } + SHOW_ALL: ClassVar["SyntheticsTestOptionsMonitorOptionsNotificationPresetName"] + HIDE_ALL: ClassVar["SyntheticsTestOptionsMonitorOptionsNotificationPresetName"] + HIDE_QUERY: ClassVar["SyntheticsTestOptionsMonitorOptionsNotificationPresetName"] + HIDE_HANDLES: ClassVar["SyntheticsTestOptionsMonitorOptionsNotificationPresetName"] + HIDE_QUERY_AND_HANDLES: ClassVar["SyntheticsTestOptionsMonitorOptionsNotificationPresetName"] + SHOW_ONLY_SNAPSHOT: ClassVar["SyntheticsTestOptionsMonitorOptionsNotificationPresetName"] + HIDE_HANDLES_AND_FOOTER: ClassVar["SyntheticsTestOptionsMonitorOptionsNotificationPresetName"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsTestOptionsMonitorOptionsNotificationPresetName.SHOW_ALL = ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName("show_all") +) +SyntheticsTestOptionsMonitorOptionsNotificationPresetName.HIDE_ALL = ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_all") +) +SyntheticsTestOptionsMonitorOptionsNotificationPresetName.HIDE_QUERY = ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_query") +) +SyntheticsTestOptionsMonitorOptionsNotificationPresetName.HIDE_HANDLES = ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_handles") +) +SyntheticsTestOptionsMonitorOptionsNotificationPresetName.HIDE_QUERY_AND_HANDLES = ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_query_and_handles") +) +SyntheticsTestOptionsMonitorOptionsNotificationPresetName.SHOW_ONLY_SNAPSHOT = ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName("show_only_snapshot") +) +SyntheticsTestOptionsMonitorOptionsNotificationPresetName.HIDE_HANDLES_AND_FOOTER = ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_handles_and_footer") +) diff --git a/src/datadog_api_client/v2/model/synthetics_test_options_retry.py b/src/datadog_api_client/v2/model/synthetics_test_options_retry.py new file mode 100644 index 0000000000..0a5d05dc89 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_options_retry.py @@ -0,0 +1,45 @@ +# 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 Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class SyntheticsTestOptionsRetry(ModelNormal): + @cached_property + def openapi_types(_): + return { + "count": (int,), + "interval": (float,), + } + + attribute_map = { + "count": "count", + "interval": "interval", + } + + def __init__(self_, count: Union[int, UnsetType] = unset, interval: Union[float, UnsetType] = unset, **kwargs): + """ + Object describing the retry strategy to apply to a Synthetic test. + + :param count: Number of times a test needs to be retried before marking a + location as failed. Defaults to 0. + :type count: int, optional + + :param interval: Time interval between retries (in milliseconds). Defaults to + 300ms. + :type interval: float, optional + """ + if count is not unset: + kwargs["count"] = count + if interval is not unset: + kwargs["interval"] = interval + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/synthetics_test_options_scheduling.py b/src/datadog_api_client/v2/model/synthetics_test_options_scheduling.py new file mode 100644 index 0000000000..49027cb11e --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_options_scheduling.py @@ -0,0 +1,50 @@ +# 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 List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_test_options_scheduling_timeframe import ( + SyntheticsTestOptionsSchedulingTimeframe, + ) + + +class SyntheticsTestOptionsScheduling(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_test_options_scheduling_timeframe import ( + SyntheticsTestOptionsSchedulingTimeframe, + ) + + return { + "timeframes": ([SyntheticsTestOptionsSchedulingTimeframe],), + "timezone": (str,), + } + + attribute_map = { + "timeframes": "timeframes", + "timezone": "timezone", + } + + def __init__(self_, timeframes: List[SyntheticsTestOptionsSchedulingTimeframe], timezone: str, **kwargs): + """ + Object containing timeframes and timezone used for advanced scheduling. + + :param timeframes: Array containing objects describing the scheduling pattern to apply to each day. + :type timeframes: [SyntheticsTestOptionsSchedulingTimeframe] + + :param timezone: Timezone in which the timeframe is based. + :type timezone: str + """ + super().__init__(kwargs) + + self_.timeframes = timeframes + self_.timezone = timezone diff --git a/src/datadog_api_client/v2/model/synthetics_test_options_scheduling_timeframe.py b/src/datadog_api_client/v2/model/synthetics_test_options_scheduling_timeframe.py new file mode 100644 index 0000000000..69501931fa --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_options_scheduling_timeframe.py @@ -0,0 +1,52 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class SyntheticsTestOptionsSchedulingTimeframe(ModelNormal): + validations = { + "day": { + "inclusive_maximum": 7, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "day": (int,), + "_from": (str,), + "to": (str,), + } + + attribute_map = { + "day": "day", + "_from": "from", + "to": "to", + } + + def __init__(self_, day: int, _from: str, to: str, **kwargs): + """ + Object describing a timeframe. + + :param day: Number representing the day of the week. + :type day: int + + :param _from: The hour of the day on which scheduling starts. + :type _from: str + + :param to: The hour of the day on which scheduling ends. + :type to: str + """ + super().__init__(kwargs) + + self_.day = day + self_._from = _from + self_.to = to diff --git a/src/datadog_api_client/v2/model/synthetics_test_pause_status.py b/src/datadog_api_client/v2/model/synthetics_test_pause_status.py new file mode 100644 index 0000000000..f0bdd58f5d --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_test_pause_status.py @@ -0,0 +1,39 @@ +# 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 SyntheticsTestPauseStatus(ModelSimple): + """ + Define whether you want to start (`live`) or pause (`paused`) a + Synthetic test. + + :param value: Must be one of ["live", "paused"]. + :type value: str + """ + + allowed_values = { + "live", + "paused", + } + LIVE: ClassVar["SyntheticsTestPauseStatus"] + PAUSED: ClassVar["SyntheticsTestPauseStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsTestPauseStatus.LIVE = SyntheticsTestPauseStatus("live") +SyntheticsTestPauseStatus.PAUSED = SyntheticsTestPauseStatus("paused") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 400d568fb4..3c37283e41 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1559,6 +1559,14 @@ from datadog_api_client.v2.model.deleted_suites_request_delete_request import DeletedSuitesRequestDeleteRequest from datadog_api_client.v2.model.deleted_suites_request_type import DeletedSuitesRequestType from datadog_api_client.v2.model.deleted_suites_response import DeletedSuitesResponse +from datadog_api_client.v2.model.deleted_test_response_data import DeletedTestResponseData +from datadog_api_client.v2.model.deleted_test_response_data_attributes import DeletedTestResponseDataAttributes +from datadog_api_client.v2.model.deleted_tests_request_delete import DeletedTestsRequestDelete +from datadog_api_client.v2.model.deleted_tests_request_delete_attributes import DeletedTestsRequestDeleteAttributes +from datadog_api_client.v2.model.deleted_tests_request_delete_request import DeletedTestsRequestDeleteRequest +from datadog_api_client.v2.model.deleted_tests_request_type import DeletedTestsRequestType +from datadog_api_client.v2.model.deleted_tests_response import DeletedTestsResponse +from datadog_api_client.v2.model.deleted_tests_response_type import DeletedTestsResponseType from datadog_api_client.v2.model.dependency_location import DependencyLocation from datadog_api_client.v2.model.deployment import Deployment from datadog_api_client.v2.model.deployment_attributes import DeploymentAttributes @@ -5443,6 +5451,36 @@ SyntheticsGlobalVariableTOTPParameters, ) from datadog_api_client.v2.model.synthetics_global_variable_value import SyntheticsGlobalVariableValue +from datadog_api_client.v2.model.synthetics_network_assertion import SyntheticsNetworkAssertion +from datadog_api_client.v2.model.synthetics_network_assertion_jitter import SyntheticsNetworkAssertionJitter +from datadog_api_client.v2.model.synthetics_network_assertion_jitter_type import SyntheticsNetworkAssertionJitterType +from datadog_api_client.v2.model.synthetics_network_assertion_latency import SyntheticsNetworkAssertionLatency +from datadog_api_client.v2.model.synthetics_network_assertion_latency_type import SyntheticsNetworkAssertionLatencyType +from datadog_api_client.v2.model.synthetics_network_assertion_multi_network_hop import ( + SyntheticsNetworkAssertionMultiNetworkHop, +) +from datadog_api_client.v2.model.synthetics_network_assertion_multi_network_hop_type import ( + SyntheticsNetworkAssertionMultiNetworkHopType, +) +from datadog_api_client.v2.model.synthetics_network_assertion_operator import SyntheticsNetworkAssertionOperator +from datadog_api_client.v2.model.synthetics_network_assertion_packet_loss_percentage import ( + SyntheticsNetworkAssertionPacketLossPercentage, +) +from datadog_api_client.v2.model.synthetics_network_assertion_packet_loss_percentage_type import ( + SyntheticsNetworkAssertionPacketLossPercentageType, +) +from datadog_api_client.v2.model.synthetics_network_assertion_property import SyntheticsNetworkAssertionProperty +from datadog_api_client.v2.model.synthetics_network_test import SyntheticsNetworkTest +from datadog_api_client.v2.model.synthetics_network_test_config import SyntheticsNetworkTestConfig +from datadog_api_client.v2.model.synthetics_network_test_edit import SyntheticsNetworkTestEdit +from datadog_api_client.v2.model.synthetics_network_test_edit_request import SyntheticsNetworkTestEditRequest +from datadog_api_client.v2.model.synthetics_network_test_request import SyntheticsNetworkTestRequest +from datadog_api_client.v2.model.synthetics_network_test_request_tcp_method import SyntheticsNetworkTestRequestTCPMethod +from datadog_api_client.v2.model.synthetics_network_test_response import SyntheticsNetworkTestResponse +from datadog_api_client.v2.model.synthetics_network_test_response_data import SyntheticsNetworkTestResponseData +from datadog_api_client.v2.model.synthetics_network_test_response_type import SyntheticsNetworkTestResponseType +from datadog_api_client.v2.model.synthetics_network_test_sub_type import SyntheticsNetworkTestSubType +from datadog_api_client.v2.model.synthetics_network_test_type import SyntheticsNetworkTestType from datadog_api_client.v2.model.synthetics_suite import SyntheticsSuite from datadog_api_client.v2.model.synthetics_suite_options import SyntheticsSuiteOptions from datadog_api_client.v2.model.synthetics_suite_response import SyntheticsSuiteResponse @@ -5458,6 +5496,17 @@ ) from datadog_api_client.v2.model.synthetics_suite_type import SyntheticsSuiteType from datadog_api_client.v2.model.synthetics_suite_types import SyntheticsSuiteTypes +from datadog_api_client.v2.model.synthetics_test_options import SyntheticsTestOptions +from datadog_api_client.v2.model.synthetics_test_options_monitor_options import SyntheticsTestOptionsMonitorOptions +from datadog_api_client.v2.model.synthetics_test_options_monitor_options_notification_preset_name import ( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName, +) +from datadog_api_client.v2.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry +from datadog_api_client.v2.model.synthetics_test_options_scheduling import SyntheticsTestOptionsScheduling +from datadog_api_client.v2.model.synthetics_test_options_scheduling_timeframe import ( + SyntheticsTestOptionsSchedulingTimeframe, +) +from datadog_api_client.v2.model.synthetics_test_pause_status import SyntheticsTestPauseStatus from datadog_api_client.v2.model.synthetics_variable_parser import SyntheticsVariableParser from datadog_api_client.v2.model.table_result_v2 import TableResultV2 from datadog_api_client.v2.model.table_result_v2_array import TableResultV2Array @@ -7093,6 +7142,14 @@ "DeletedSuitesRequestDeleteRequest", "DeletedSuitesRequestType", "DeletedSuitesResponse", + "DeletedTestResponseData", + "DeletedTestResponseDataAttributes", + "DeletedTestsRequestDelete", + "DeletedTestsRequestDeleteAttributes", + "DeletedTestsRequestDeleteRequest", + "DeletedTestsRequestType", + "DeletedTestsResponse", + "DeletedTestsResponseType", "DependencyLocation", "Deployment", "DeploymentAttributes", @@ -9795,6 +9852,28 @@ "SyntheticsGlobalVariableParserType", "SyntheticsGlobalVariableTOTPParameters", "SyntheticsGlobalVariableValue", + "SyntheticsNetworkAssertion", + "SyntheticsNetworkAssertionJitter", + "SyntheticsNetworkAssertionJitterType", + "SyntheticsNetworkAssertionLatency", + "SyntheticsNetworkAssertionLatencyType", + "SyntheticsNetworkAssertionMultiNetworkHop", + "SyntheticsNetworkAssertionMultiNetworkHopType", + "SyntheticsNetworkAssertionOperator", + "SyntheticsNetworkAssertionPacketLossPercentage", + "SyntheticsNetworkAssertionPacketLossPercentageType", + "SyntheticsNetworkAssertionProperty", + "SyntheticsNetworkTest", + "SyntheticsNetworkTestConfig", + "SyntheticsNetworkTestEdit", + "SyntheticsNetworkTestEditRequest", + "SyntheticsNetworkTestRequest", + "SyntheticsNetworkTestRequestTCPMethod", + "SyntheticsNetworkTestResponse", + "SyntheticsNetworkTestResponseData", + "SyntheticsNetworkTestResponseType", + "SyntheticsNetworkTestSubType", + "SyntheticsNetworkTestType", "SyntheticsSuite", "SyntheticsSuiteOptions", "SyntheticsSuiteResponse", @@ -9806,6 +9885,13 @@ "SyntheticsSuiteTestAlertingCriticality", "SyntheticsSuiteType", "SyntheticsSuiteTypes", + "SyntheticsTestOptions", + "SyntheticsTestOptionsMonitorOptions", + "SyntheticsTestOptionsMonitorOptionsNotificationPresetName", + "SyntheticsTestOptionsRetry", + "SyntheticsTestOptionsScheduling", + "SyntheticsTestOptionsSchedulingTimeframe", + "SyntheticsTestPauseStatus", "SyntheticsVariableParser", "TableResultV2", "TableResultV2Array", diff --git a/tests/v1/features/synthetics.feature b/tests/v1/features/synthetics.feature index 25b209f05a..9b362dbe23 100644 --- a/tests/v1/features/synthetics.feature +++ b/tests/v1/features/synthetics.feature @@ -1,13 +1,15 @@ @endpoint(synthetics) @endpoint(synthetics-v1) Feature: Synthetics - Datadog Synthetic Monitoring uses simulated user requests and browser - rendering to help you ensure uptime, identify regional issues, and track - your application performance. Synthetic tests come in two different - flavors, [API - tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest) and - [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You - can use Datadog's API to manage both test types programmatically. For - more information, see the [Synthetic Monitoring + Synthetic tests use simulated requests and actions so you can monitor the + availability and performance of systems and applications. Datadog supports + the following types of synthetic tests: - [API + tests](https://docs.datadoghq.com/synthetics/api_tests/) - [Browser + tests](https://docs.datadoghq.com/synthetics/browser_tests) - [Network + Path tests](https://docs.datadoghq.com/synthetics/network_path_tests/) - + [Mobile Application + tests](https://docs.datadoghq.com/synthetics/mobile_app_testing) You can + use the Datadog API to create, manage, and organize tests and test suites + programmatically. For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/). Background: diff --git a/tests/v2/cassettes/test_scenarios/test_synthetics_create_a_network_path_test_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_synthetics_create_a_network_path_test_returns_ok_response.frozen new file mode 100644 index 0000000000..d30828c2f7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_synthetics_create_a_network_path_test_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-02-02T10:35:23.539Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_synthetics_create_a_network_path_test_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_synthetics_create_a_network_path_test_returns_ok_response.yaml new file mode 100644 index 0000000000..d8e016f24b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_synthetics_create_a_network_path_test_returns_ok_response.yaml @@ -0,0 +1,45 @@ +interactions: +- request: + body: '{"data":{"attributes":{"config":{"assertions":[{"operator":"lessThan","property":"avg","target":500,"type":"latency"}],"request":{"e2e_queries":50,"host":"example.com","max_ttl":30,"port":443,"tcp_method":"prefer_sack","traceroute_queries":3}},"locations":["aws:us-east-1","agent:my-agent-name"],"message":"Network + Path test notification","name":"Example Network Path test","options":{"tick_every":60},"status":"live","subtype":"tcp","tags":["env:production"],"type":"network"},"type":"network"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/synthetics/tests/network + response: + body: + string: '{"data":{"type":"network_test","attributes":{"public_id":"iab-wcx-mhp","name":"Example + Network Path test","locations":["aws:us-east-1","agent:my-agent-name"],"subtype":"tcp","status":"live","options":{"tick_every":60},"config":{"assertions":[{"operator":"lessThan","property":"avg","target":500,"type":"latency"}],"request":{"max_ttl":30,"tcp_method":"prefer_sack","host":"example.com","traceroute_queries":3,"e2e_queries":50,"port":443}},"type":"network","tags":["env:production"],"message":"Network + Path test notification"},"id":"iab-wcx-mhp"}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"public_ids":["iab-wcx-mhp"]},"type":"delete_tests_request"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/synthetics/tests/bulk-delete + response: + body: + string: '{"data":[{"type":"delete_tests","attributes":{"deleted_at":"2026-02-02T10:35:25.382918+00:00","public_id":"iab-wcx-mhp"},"id":"iab-wcx-mhp"}]} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_synthetics_get_a_network_path_test_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_synthetics_get_a_network_path_test_returns_ok_response.frozen new file mode 100644 index 0000000000..7ba3f2dd33 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_synthetics_get_a_network_path_test_returns_ok_response.frozen @@ -0,0 +1 @@ +2026-01-29T16:23:56.538Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_synthetics_get_a_network_path_test_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_synthetics_get_a_network_path_test_returns_ok_response.yaml new file mode 100644 index 0000000000..0561c00755 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_synthetics_get_a_network_path_test_returns_ok_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/synthetics/tests/network/amg-96x-tps + response: + body: + string: '{"data":{"type":"network_test","attributes":{"config":{"request":{"traceroute_queries":3,"tcp_method":"prefer_sack","max_ttl":30,"e2e_queries":50,"host":"example.com","port":443},"assertions":[{"operator":"lessThan","property":"avg","target":500,"type":"latency"}]},"public_id":"amg-96x-tps","locations":["aws:us-east-1","agent:my-agent-name"],"options":{"tick_every":60},"name":"Example + Network Path test","message":"Network Path test notification","type":"network","status":"paused","subtype":"tcp","tags":["env:production"]},"id":"amg-96x-tps"}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/synthetics.feature b/tests/v2/features/synthetics.feature index 5697490c97..07b9750052 100644 --- a/tests/v2/features/synthetics.feature +++ b/tests/v2/features/synthetics.feature @@ -1,13 +1,16 @@ @endpoint(synthetics) @endpoint(synthetics-v2) Feature: Synthetics - Datadog Synthetics uses simulated user requests and browser rendering to - help you ensure uptime, identify regional issues, and track your - application performance. Datadog Synthetics tests come in two different - flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/) and - [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You - can use Datadog’s API to manage both test types programmatically. For - more information about Synthetics, see the [Synthetics - overview](https://docs.datadoghq.com/synthetics/). + Synthetic tests use simulated requests and actions so you can monitor the + availability and performance of systems and applications. Datadog supports + the following types of synthetic tests: - [API + tests](https://docs.datadoghq.com/synthetics/api_tests/) - [Browser + tests](https://docs.datadoghq.com/synthetics/browser_tests) - [Network + Path tests](https://docs.datadoghq.com/synthetics/network_path_tests/) - + [Mobile Application + tests](https://docs.datadoghq.com/synthetics/mobile_app_testing) You can + use the Datadog API to create, manage, and organize tests and test suites + programmatically. For more information, see the [Synthetic Monitoring + documentation](https://docs.datadoghq.com/synthetics/). Background: Given a valid "apiKeyAuth" key in the system @@ -78,6 +81,34 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Bulk delete tests returns "API error response." response + Given new "DeleteSyntheticsTests" request + And body with value {"data": {"attributes": {"public_ids": [""]}, "type": "delete_tests_request"}} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Bulk delete tests returns "OK" response + Given new "DeleteSyntheticsTests" request + And body with value {"data": {"attributes": {"public_ids": [""]}, "type": "delete_tests_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Create a Network Path test returns "API error response." response + Given new "CreateSyntheticsNetworkTest" request + And body with value {"data": {"attributes": {"config": {"assertions": [{"operator": "lessThan", "property": "avg", "target": 500, "type": "latency"}], "request": {"e2e_queries": 50, "host": "", "max_ttl": 30, "port": 443, "tcp_method": "prefer_sack", "traceroute_queries": 3}}, "locations": ["aws:us-east-1", "agent:my-agent-name"], "message": "Network Path test notification", "name": "Example Network Path test", "options": {"monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "tcp", "tags": ["env:production"], "type": "network"}, "type": "network"}} + When the request is sent + Then the response status is 400 API error response. + + @team:DataDog/synthetics-managing + Scenario: Synthetics: Create a Network Path test returns "OK" response + Given new "CreateSyntheticsNetworkTest" request + And body with value {"data": {"attributes": {"config": {"assertions": [{"operator": "lessThan", "property": "avg", "target": 500, "type": "latency"}], "request": {"host": "example.com", "port": 443, "tcp_method": "prefer_sack", "max_ttl": 30, "e2e_queries": 50, "traceroute_queries": 3}}, "locations": ["aws:us-east-1", "agent:my-agent-name"], "message": "Network Path test notification", "name": "Example Network Path test", "options": {"tick_every": 60}, "status": "live", "subtype": "tcp", "tags": ["env:production"], "type": "network"}, "type": "network"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Synthetics: Create a test suite returns "API error response." response Given new "CreateSyntheticsSuite" request @@ -92,6 +123,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Edit a Network Path test returns "API error response." response + Given new "UpdateSyntheticsNetworkTest" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"assertions": [{"operator": "lessThan", "property": "avg", "target": 500, "type": "latency"}], "request": {"e2e_queries": 50, "host": "", "max_ttl": 30, "port": 443, "tcp_method": "prefer_sack", "traceroute_queries": 3}}, "locations": ["aws:us-east-1", "agent:my-agent-name"], "message": "Network Path test notification", "name": "Example Network Path test", "options": {"monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "tcp", "tags": ["env:production"], "type": "network"}, "type": "network"}} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Edit a Network Path test returns "OK" response + Given new "UpdateSyntheticsNetworkTest" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"assertions": [{"operator": "lessThan", "property": "avg", "target": 500, "type": "latency"}], "request": {"e2e_queries": 50, "host": "", "max_ttl": 30, "port": 443, "tcp_method": "prefer_sack", "traceroute_queries": 3}}, "locations": ["aws:us-east-1", "agent:my-agent-name"], "message": "Network Path test notification", "name": "Example Network Path test", "options": {"monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "tcp", "tags": ["env:production"], "type": "network"}, "type": "network"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Synthetics: Edit a test suite returns "API error response." response Given new "EditSyntheticsSuite" request @@ -108,6 +155,20 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Get a Network Path test returns "API error response." response + Given new "GetSyntheticsNetworkTest" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @replay-only @team:DataDog/synthetics-managing + Scenario: Synthetics: Get a Network Path test returns "OK" response + Given new "GetSyntheticsNetworkTest" request + And request contains "public_id" parameter with value "amg-96x-tps" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Synthetics: Get a suite returns "API error response." response Given new "GetSyntheticsSuite" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 7e549784ee..20f6cbedfa 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -5245,6 +5245,37 @@ "type": "idempotent" } }, + "DeleteSyntheticsTests": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, + "CreateSyntheticsNetworkTest": { + "tag": "Synthetics", + "undo": { + "operationId": "DeleteSyntheticsTests", + "parameters": [ + { + "name": "body", + "template": "{\"data\": {\"type\": \"delete_tests_request\", \"attributes\": {\"public_ids\": [\"{{ data.attributes.public_id }}\"]}}}" + } + ], + "type": "unsafe" + } + }, + "GetSyntheticsNetworkTest": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "UpdateSyntheticsNetworkTest": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, "PatchGlobalVariable": { "tag": "Synthetics", "undo": {